aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2014-06-17 17:45:00 +0200
committerAnders Broman <a.broman58@gmail.com>2014-06-18 14:14:58 +0000
commit246fe2ca4c67d8c98caa84e2f57694f6322e2f96 (patch)
tree5f8651517a3423cce11c50e18371d8a73c3c7665 /epan/dissectors
parent971ffd683ea23362bd8009567ff7860371e6e2cc (diff)
Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors')
-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)
offset = *offset_p;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length < 7)
{
@@ -2777,7 +2777,7 @@ dis_msg_deliver(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 off
gboolean udhi;
saved_offset = offset;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
oct = tvb_get_guint8(tvb, offset);
udhi = oct & 0x40;
@@ -2839,7 +2839,7 @@ dis_msg_deliver_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin
udl = 0;
saved_offset = offset;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
oct = tvb_get_guint8(tvb, offset);
udhi = oct & 0x40;
@@ -2958,7 +2958,7 @@ dis_msg_submit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offs
saved_offset = offset;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
oct = tvb_get_guint8(tvb, offset);
udhi = oct & 0x40;
@@ -3026,7 +3026,7 @@ dis_msg_submit_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
udl = 0;
saved_offset = offset;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
oct = tvb_get_guint8(tvb, offset);
udhi = oct & 0x40;
@@ -3136,7 +3136,7 @@ dis_msg_status_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
udl = 0;
saved_offset = offset;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
oct = tvb_get_guint8(tvb, offset);
udhi = oct & 0x40;
@@ -3361,7 +3361,7 @@ dissect_gsm_sms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
(msg_type == 0x03) ||
(msg_type == 0x07))
{
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
else
{
@@ -3380,7 +3380,7 @@ dissect_gsm_sms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
(*msg_fcn)(tvb, pinfo, gsm_sms_tree, offset, gsm_data);
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-gsm_um.c b/epan/dissectors/packet-gsm_um.c
index c6190f8f42..1190a63bc8 100644
--- a/epan/dissectors/packet-gsm_um.c
+++ b/epan/dissectors/packet-gsm_um.c
@@ -198,7 +198,7 @@ dissect_gsm_um(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *next_tvb;
guint8 pseudo_len, len_left, len_byte;
- len_left = tvb_length(tvb);
+ len_left = tvb_captured_length(tvb);
len_byte = tvb_get_guint8(tvb, 0);
pseudo_len = len_byte >> 2;
next_tvb = tvb_new_subset(tvb, 1, MIN(len_left, pseudo_len), -1);
@@ -209,7 +209,7 @@ dissect_gsm_um(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Only dissect non-empty frames */
- if( tvb_length(next_tvb) ) {
+ if( tvb_captured_length(next_tvb) ) {
call_dissector(dtap_handle, next_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-gsmtap.c b/epan/dissectors/packet-gsmtap.c
index da057d7551..d83ba5e265 100644
--- a/epan/dissectors/packet-gsmtap.c
+++ b/epan/dissectors/packet-gsmtap.c
@@ -477,7 +477,7 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 hdr_len, type, sub_type, timeslot, subslot;
guint16 arfcn;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
hdr_len = tvb_get_guint8(tvb, offset + 1) <<2;
type = tvb_get_guint8(tvb, offset + 2);
diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c
index 4a94e335aa..33621614ab 100644
--- a/epan/dissectors/packet-gssapi.c
+++ b/epan/dissectors/packet-gssapi.c
@@ -262,8 +262,8 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
fd_head=fragment_add(&gssapi_reassembly_table,
tvb, 0, pinfo, fi->first_frame, NULL,
gss_info->frag_offset,
- tvb_length(tvb), TRUE);
- gss_info->frag_offset+=tvb_length(tvb);
+ tvb_captured_length(tvb), TRUE);
+ gss_info->frag_offset+=tvb_captured_length(tvb);
/* we need more fragments */
if(!fd_head){
@@ -310,14 +310,14 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (!(appclass == BER_CLASS_APP && pc && tag == 0)) {
/* It could be NTLMSSP, with no OID. This can happen
for anything that microsoft calls 'Negotiate' or GSS-SPNEGO */
- if ((tvb_length_remaining(gss_tvb, start_offset)>7) && (tvb_strneql(gss_tvb, start_offset, "NTLMSSP", 7) == 0)) {
+ if ((tvb_captured_length_remaining(gss_tvb, start_offset)>7) && (tvb_strneql(gss_tvb, start_offset, "NTLMSSP", 7) == 0)) {
return_offset = call_dissector(ntlmssp_handle,
tvb_new_subset_remaining(gss_tvb, start_offset),
pinfo, subtree);
goto done;
}
/* Maybe it's new NTLMSSP payload */
- if ((tvb_length_remaining(gss_tvb, start_offset)>16) &&
+ if ((tvb_captured_length_remaining(gss_tvb, start_offset)>16) &&
((tvb_memeql(gss_tvb, start_offset, "\x01\x00\x00\x00", 4) == 0))) {
return_offset = call_dissector(ntlmssp_payload_handle,
tvb_new_subset_remaining(gss_tvb, start_offset),
@@ -325,7 +325,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pinfo->gssapi_data_encrypted = TRUE;
goto done;
}
- if ((tvb_length_remaining(gss_tvb, start_offset)==16) &&
+ if ((tvb_captured_length_remaining(gss_tvb, start_offset)==16) &&
((tvb_memeql(gss_tvb, start_offset, "\x01\x00\x00\x00", 4) == 0))) {
if( is_verifier ) {
return_offset = call_dissector(ntlmssp_verf_handle,
@@ -342,7 +342,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Maybe it's new GSSKRB5 CFX Wrapping */
- if ((tvb_length_remaining(gss_tvb, start_offset)>2) &&
+ if ((tvb_captured_length_remaining(gss_tvb, start_offset)>2) &&
((tvb_memeql(gss_tvb, start_offset, "\04\x04", 2) == 0) ||
(tvb_memeql(gss_tvb, start_offset, "\05\x04", 2) == 0))) {
return_offset = call_dissector(spnego_krb5_wrap_handle,
@@ -384,7 +384,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_text(subtree, gss_tvb, start_offset, 0,
"Unknown header (class=%d, pc=%d, tag=%d)",
appclass, pc, tag);
- return_offset = tvb_length(gss_tvb);
+ return_offset = tvb_captured_length(gss_tvb);
goto done;
} else {
tvbuff_t *oid_tvb_local;
@@ -396,7 +396,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
handle = oidvalue->handle;
len = call_dissector(handle, oid_tvb_local, pinfo, subtree);
if (len == 0)
- return_offset = tvb_length(gss_tvb);
+ return_offset = tvb_captured_length(gss_tvb);
else
return_offset = start_offset + len;
goto done; /* We are finished here */
@@ -422,8 +422,8 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
if( (!pinfo->fd->flags.visited)
&& (oidvalue)
- && (tvb_length(gss_tvb)==tvb_reported_length(gss_tvb))
- && (len1>(guint32)tvb_length_remaining(gss_tvb, oid_start_offset))
+ && (tvb_captured_length(gss_tvb)==tvb_reported_length(gss_tvb))
+ && (len1>(guint32)tvb_captured_length_remaining(gss_tvb, oid_start_offset))
&& (gssapi_reassembly) ){
fi=wmem_new(wmem_file_scope(), gssapi_frag_info_t);
fi->first_frame=pinfo->fd->num;
@@ -432,13 +432,13 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
fragment_add(&gssapi_reassembly_table,
gss_tvb, 0, pinfo, pinfo->fd->num, NULL,
- 0, tvb_length(gss_tvb), TRUE);
+ 0, tvb_captured_length(gss_tvb), TRUE);
fragment_set_tot_len(&gssapi_reassembly_table,
pinfo, pinfo->fd->num, NULL, len1+oid_start_offset);
gss_info->do_reassembly=TRUE;
gss_info->first_frame=pinfo->fd->num;
- gss_info->frag_offset=tvb_length(gss_tvb);
+ gss_info->frag_offset=tvb_captured_length(gss_tvb);
goto done;
}
@@ -453,7 +453,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_text(subtree, gss_tvb, oid_start_offset, -1,
"Token object");
- return_offset = tvb_length(gss_tvb);
+ return_offset = tvb_captured_length(gss_tvb);
goto done;
}
@@ -476,13 +476,13 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
len = call_dissector(handle, oid_tvb, pinfo,
subtree);
if (len == 0)
- return_offset = tvb_length(gss_tvb);
+ return_offset = tvb_captured_length(gss_tvb);
else
return_offset = offset + len;
} else {
proto_tree_add_text(subtree, gss_tvb, offset, -1,
"Authentication verifier");
- return_offset = tvb_length(gss_tvb);
+ return_offset = tvb_captured_length(gss_tvb);
}
} else {
handle = oidvalue->handle;
@@ -491,13 +491,13 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
len = call_dissector(handle, oid_tvb, pinfo,
subtree);
if (len == 0)
- return_offset = tvb_length(gss_tvb);
+ return_offset = tvb_captured_length(gss_tvb);
else
return_offset = offset + len;
} else {
proto_tree_add_text(subtree, gss_tvb, offset, -1,
"Authentication credentials");
- return_offset = tvb_length(gss_tvb);
+ return_offset = tvb_captured_length(gss_tvb);
}
}
@@ -615,7 +615,7 @@ wrap_dissect_gssapi(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_gssapi(auth_tvb, pinfo, tree);
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
int
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c
index da422a680c..e895620051 100644
--- a/epan/dissectors/packet-gtp.c
+++ b/epan/dissectors/packet-gtp.c
@@ -4593,7 +4593,7 @@ static int
dissect_diameter_3gpp_qosprofile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
decode_qos_umts(tvb, 0, tree, "UMTS GTP QoS Profile", 3);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static const gchar *
@@ -5607,7 +5607,7 @@ gchar *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb, packet_info* p
int offset = 0;
guint8 geo_loc_type;
- guint16 length = tvb_length(tvb);
+ guint16 length = tvb_captured_length(tvb);
/* Geographic Location Type */
proto_tree_add_item(tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -7814,7 +7814,7 @@ decode_gtp_unknown(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tr
proto_tree_add_text(tree, tvb, offset, 1, "Unknown extension header");
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
static int
@@ -8065,7 +8065,7 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (ext_hdr_length == 0) {
expert_add_info_format(pinfo, ext_hdr_len_item, &ei_gtp_ext_length_mal,
"Extension header length is zero");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
offset++;
@@ -8236,7 +8236,7 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
tap_queue_packet(gtpv1_tap,pinfo, gtp_hdr);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -8273,7 +8273,7 @@ dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
/* GTPv2-C 3GPP TS 29.274 */
if (gtpv2_handle) {
call_dissector(gtpv2_handle, tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index 1c03b4943f..75d16bf409 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -2077,7 +2077,7 @@ dissect_diameter_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
guint length;
guint flags;
guint flags_3gpp;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
flags_3gpp = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-h1.c b/epan/dissectors/packet-h1.c
index c58be462ed..3a2c3fbbc5 100644
--- a/epan/dissectors/packet-h1.c
+++ b/epan/dissectors/packet-h1.c
@@ -109,7 +109,7 @@ static gboolean dissect_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
unsigned int position = 3;
unsigned int offset=0;
- if (tvb_length(tvb) < 2)
+ if (tvb_captured_length(tvb) < 2)
{
/* Not enough data captured to hold the "S5" header; don't try
to interpret it as H1. */
diff --git a/epan/dissectors/packet-h221_nonstd.c b/epan/dissectors/packet-h221_nonstd.c
index 3ac0ab30b6..cd275d6b6a 100644
--- a/epan/dissectors/packet-h221_nonstd.c
+++ b/epan/dissectors/packet-h221_nonstd.c
@@ -58,11 +58,11 @@ dissect_ms_nonstd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
gint tvb_len;
guint16 codec_value, codec_extra;
- it=proto_tree_add_protocol_format(tree, proto_nonstd, tvb, 0, tvb_length(tvb), "Microsoft NonStd");
+ it=proto_tree_add_protocol_format(tree, proto_nonstd, tvb, 0, tvb_captured_length(tvb), "Microsoft NonStd");
tr=proto_item_add_subtree(it, ett_nonstd);
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
/*
* XXX - why do this test? Are there any cases where throwing
diff --git a/epan/dissectors/packet-h223.c b/epan/dissectors/packet-h223.c
index 6b70fcc1a3..6e0c985bfe 100644
--- a/epan/dissectors/packet-h223.c
+++ b/epan/dissectors/packet-h223.c
@@ -973,7 +973,7 @@ dissect_mux_pdu( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset,
end_of_mux_sdu = raw_hdr & 1;
offset++;
/* closing flag is one byte long for h223 level 0, two for level 1 */
- len = mpl = tvb_length_remaining(tvb, offset)-(call_info->h223_level+1);
+ len = mpl = tvb_captured_length_remaining(tvb, offset)-(call_info->h223_level+1);
/* XXX should ignore pdus with incorrect HECs */
break;
@@ -982,7 +982,7 @@ dissect_mux_pdu( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset,
raw_hdr = tvb_get_letoh24(tvb,0);
errors = golay_errors(raw_hdr);
offset += 3;
- len = tvb_length_remaining(tvb,offset)-2;
+ len = tvb_captured_length_remaining(tvb,offset)-2;
if(errors != -1) {
correct_hdr = raw_hdr ^ (guint32)errors;
@@ -1365,7 +1365,7 @@ dissect_h223_bitswapped (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 *datax;
guint len;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
datax = (guint8 *) tvb_memdup(pinfo->pool, tvb, 0, len);
bitswap_buf_inplace(datax, len);
diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c
index ae708fd52b..ff3aa76a30 100644
--- a/epan/dissectors/packet-h225.c
+++ b/epan/dissectors/packet-h225.c
@@ -1487,7 +1487,7 @@ dissect_h225_T_nsp_data(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &next_tvb);
- if (next_tvb && tvb_length(next_tvb)) {
+ if (next_tvb && tvb_captured_length(next_tvb)) {
call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, actx->pinfo, tree);
}
@@ -1584,7 +1584,7 @@ dissect_h225_DialedDigits(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
if (h225_pi && h225_pi->is_destinationInfo == TRUE) {
if (value_tvb) {
- len = tvb_length(value_tvb);
+ len = tvb_captured_length(value_tvb);
/* XXX - should this be allocated as an ephemeral string? */
if (len > sizeof h225_pi->dialedDigits - 1)
len = sizeof h225_pi->dialedDigits - 1;
@@ -3096,7 +3096,7 @@ dissect_h225_FastStart_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &value_tvb);
- if (value_tvb && tvb_length(value_tvb)) {
+ if (value_tvb && tvb_captured_length(value_tvb)) {
dissect_h245_FastStart_OLC(value_tvb, actx->pinfo, tree, codec_str);
}
@@ -4769,7 +4769,7 @@ dissect_h225_T_h4501SupplementaryService_item(tvbuff_t *tvb _U_, int offset _U_,
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &h4501_tvb);
- if (h4501_tvb && tvb_length(h4501_tvb)) {
+ if (h4501_tvb && tvb_captured_length(h4501_tvb)) {
call_dissector(h4501_handle, h4501_tvb, actx->pinfo, tree);
}
@@ -7539,7 +7539,7 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
col_clear(pinfo->cinfo, COL_INFO);
- it=proto_tree_add_protocol_format(tree, proto_h225, tvb, 0, tvb_length(tvb), PSNAME" CS");
+ it=proto_tree_add_protocol_format(tree, proto_h225, tvb, 0, tvb_captured_length(tvb), PSNAME" CS");
tr=proto_item_add_subtree(it, ett_h225);
offset = dissect_H323_UserInformation_PDU(tvb, pinfo, tr, NULL);
@@ -7574,7 +7574,7 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
- it=proto_tree_add_protocol_format(tree, proto_h225, tvb, offset, tvb_length(tvb), PSNAME" RAS");
+ it=proto_tree_add_protocol_format(tree, proto_h225, tvb, offset, tvb_captured_length(tvb), PSNAME" RAS");
tr=proto_item_add_subtree(it, ett_h225);
offset = dissect_RasMessage_PDU(tvb, pinfo, tr, NULL);
diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c
index 3591fec176..16bb7da3dc 100644
--- a/epan/dissectors/packet-h245.c
+++ b/epan/dissectors/packet-h245.c
@@ -2574,7 +2574,7 @@ dissect_h245_T_nsd_data(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &next_tvb);
- if (next_tvb && tvb_length(next_tvb)) {
+ if (next_tvb && tvb_captured_length(next_tvb)) {
call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, actx->pinfo, tree);
}
@@ -14236,7 +14236,7 @@ dissect_h245_T_returnedFunction(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
NO_BOUND, NO_BOUND, FALSE, &next_tvb);
- if (next_tvb && tvb_length(next_tvb)) {
+ if (next_tvb && tvb_captured_length(next_tvb)) {
saved_h245_pi = h245_pi;
h245_pi = NULL;
item = proto_tree_add_text(tree, next_tvb, 0, -1,"The returned function");
@@ -14517,11 +14517,11 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
- it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_length(tvb), PSNAME);
+ it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_captured_length(tvb), PSNAME);
tr=proto_item_add_subtree(it, ett_h245);
/* assume that whilst there is more tvb data, there are more h245 commands */
- while ( tvb_length_remaining( tvb, offset>>3 )>0 ){
+ while ( tvb_captured_length_remaining( tvb, offset>>3 )>0 ){
CLEANUP_PUSH(reset_h245_pi, NULL);
h245_pi=wmem_new(wmem_packet_scope(), h245_packet_info);
init_h245_packet_info(h245_pi);
diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c
index d646e4c050..101310397e 100644
--- a/epan/dissectors/packet-h248.c
+++ b/epan/dissectors/packet-h248.c
@@ -1280,7 +1280,7 @@ static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_
offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
} else {
- len=tvb_length_remaining(tvb, offset);
+ len=tvb_captured_length_remaining(tvb, offset);
}
@@ -1318,7 +1318,7 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_
offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
} else {
- len=tvb_length_remaining(tvb, offset);
+ len=tvb_captured_length_remaining(tvb, offset);
}
@@ -1712,7 +1712,7 @@ static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tv
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &next_tvb);
pi = actx->created_item;
- switch(tvb_length(next_tvb)) {
+ switch(tvb_captured_length(next_tvb)) {
case 4: param_id = tvb_get_ntohl(next_tvb,0); break;
case 3: param_id = tvb_get_ntoh24(next_tvb,0); break;
case 2: param_id = tvb_get_ntohs(next_tvb,0); break;
@@ -1785,7 +1785,7 @@ static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *
pi = actx->created_item;
if (next_tvb) {
- switch(tvb_length(next_tvb)) {
+ switch(tvb_captured_length(next_tvb)) {
case 4: param_id = tvb_get_ntohl(next_tvb,0); break;
case 3: param_id = tvb_get_ntoh24(next_tvb,0); break;
case 2: param_id = tvb_get_ntohs(next_tvb,0); break;
@@ -1864,7 +1864,7 @@ static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int off
if (new_tvb) {
/* this field is either 2 or 4 bytes so just read it into an integer */
val=0;
- len=tvb_length(new_tvb);
+ len=tvb_captured_length(new_tvb);
for(i=0;i<len;i++){
val= (val<<8)|tvb_get_guint8(new_tvb, i);
}
@@ -2231,7 +2231,7 @@ dissect_h248_T_terminationId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb);
if (new_tvb) {
- curr_info.term->len = tvb_length(new_tvb);
+ curr_info.term->len = tvb_captured_length(new_tvb);
curr_info.term->type = 0; /* unknown */
if (h248_term_handle) {
@@ -5353,7 +5353,7 @@ dissect_h248_ValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
#line 398 "../../asn1/h248/h248.cnf"
/* check tvb to verify all values ascii or not. If so, output string, else hex */
- len=tvb_length_remaining(tvb, offset);
+ len=tvb_captured_length_remaining(tvb, offset);
if ( curr_info.par && curr_info.par->dissector) {
curr_info.par->dissector(tree, /*next_*/tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data);
} else {
@@ -5412,7 +5412,7 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect with the "megaco" dissector in Wireshark. (Both
encodings are MEGACO (RFC 3015) and both are H.248.)
*/
- if(tvb_length(tvb)>=6){
+ if(tvb_captured_length(tvb)>=6){
if(!tvb_strneql(tvb, 0, "MEGACO", 6)){
static dissector_handle_t megaco_handle=NULL;
if(!megaco_handle){
diff --git a/epan/dissectors/packet-h248_3gpp.c b/epan/dissectors/packet-h248_3gpp.c
index 285c67dfe0..5343295245 100644
--- a/epan/dissectors/packet-h248_3gpp.c
+++ b/epan/dissectors/packet-h248_3gpp.c
@@ -167,7 +167,7 @@ static void dissect_3gcsd_plmnbc(proto_tree* tree, tvbuff_t* tvb, packet_info* p
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
dissect_ber_octet_string(implicit_param ? *((gboolean*)implicit_param) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL);
- de_bearer_cap(tvb, tree, pinfo, 4, tvb_length(tvb)-4, NULL, 0);
+ de_bearer_cap(tvb, tree, pinfo, 4, tvb_captured_length(tvb)-4, NULL, 0);
}
static const value_string h248_3GCSD_properties_vals[] = {
@@ -310,7 +310,7 @@ static void dissect_3GTFO_codec_mode(proto_tree* tree, tvbuff_t* tvb, packet_inf
if (sub_tvb) {
proto_tree* pt = proto_item_add_subtree(asn1_ctx.created_item, ett_h248_3GTFO_codec);
- dissect_codec_mode(pt, sub_tvb, 0, tvb_length(tvb));
+ dissect_codec_mode(pt, sub_tvb, 0, tvb_captured_length(tvb));
}
} else {
proto_tree_add_item(tree,hfid,tvb,0,-1,ENC_NA);
@@ -334,7 +334,7 @@ static void dissect_3GTFO_codec_list(proto_tree* tree, tvbuff_t* tvb, packet_inf
if (sub_tvb) {
proto_tree* pt = proto_item_add_subtree(asn1_ctx.created_item,ett_h248_3GTFO_codec_list);
- int len = tvb_length(sub_tvb);
+ int len = tvb_captured_length(sub_tvb);
int offset = 0;
do {
offset = dissect_codec_mode(pt, sub_tvb, offset, len);
diff --git a/epan/dissectors/packet-h248_annex_c.c b/epan/dissectors/packet-h248_annex_c.c
index db31f5c012..d6c7d1b924 100644
--- a/epan/dissectors/packet-h248_annex_c.c
+++ b/epan/dissectors/packet-h248_annex_c.c
@@ -749,7 +749,7 @@ static void dissect_h248_annexc_acodec(proto_tree* tree,
dissect_ber_octet_string(implicit_p ? *((gboolean*)implicit_p) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, &new_tvb);
tree = proto_item_add_subtree(asn1_ctx.created_item,ett_codec);
- len = tvb_length(new_tvb);
+ len = tvb_captured_length(new_tvb);
dissect_codec_mode(tree,new_tvb,0,len);
}
@@ -766,7 +766,7 @@ static void dissect_h248_annexc_BIR(proto_tree* tree,
dissect_ber_octet_string(implicit_p ? *((gboolean*)implicit_p) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, &new_tvb);
if ( new_tvb && h248_info->term && ! h248_info->term->bir ) {
- h248_info->term->bir = wmem_strdup(wmem_file_scope(), tvb_bytes_to_ep_str(new_tvb,0,tvb_length(new_tvb)));
+ h248_info->term->bir = wmem_strdup(wmem_file_scope(), tvb_bytes_to_ep_str(new_tvb,0,tvb_captured_length(new_tvb)));
}
}
@@ -782,9 +782,9 @@ static void dissect_h248_annexc_NSAP(proto_tree* tree,
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
dissect_ber_octet_string(implicit_p ? *((gboolean*)implicit_p) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, &new_tvb);
if (new_tvb) {
- dissect_nsap(new_tvb, 0,tvb_length(new_tvb), tree);
+ dissect_nsap(new_tvb, 0,tvb_captured_length(new_tvb), tree);
if ( h248_info->term && ! h248_info->term->nsap) {
- h248_info->term->nsap = wmem_strdup(wmem_file_scope(), tvb_bytes_to_ep_str(new_tvb,0,tvb_length(new_tvb)));
+ h248_info->term->nsap = wmem_strdup(wmem_file_scope(), tvb_bytes_to_ep_str(new_tvb,0,tvb_captured_length(new_tvb)));
}
}
}
@@ -803,7 +803,7 @@ static void dissect_h248_annexc_USI(proto_tree* tree, tvbuff_t* tvb, packet_info
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
dissect_ber_octet_string(implicit_p ? *((gboolean*)implicit_p) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, &new_tvb);
if (new_tvb)
- dissect_q931_bearer_capability_ie(new_tvb, 0, tvb_length(new_tvb), tree);
+ dissect_q931_bearer_capability_ie(new_tvb, 0, tvb_captured_length(new_tvb), tree);
}
static void dissect_h248_annexc_SDP(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* h248_info _U_, void* implicit_p _U_) {
diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c
index 70d5b17810..63c076612e 100644
--- a/epan/dissectors/packet-h264.c
+++ b/epan/dissectors/packet-h264.c
@@ -673,13 +673,13 @@ more_rbsp_data(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, gint
/* Set offset to the byte we are treating */
offset = bit_offset>>3;
- remaining_length = tvb_length_remaining(tvb, offset);
+ remaining_length = tvb_captured_length_remaining(tvb, offset);
/* If there is more then 2 bytes left there *should* be more data */
if (remaining_length>2) {
return TRUE;
}
/* Start from last bit */
- last_one_bit = (tvb_length(tvb) << 3);
+ last_one_bit = (tvb_captured_length(tvb) << 3);
for (b = 0; !b; ) {
last_one_bit--;
@@ -1064,7 +1064,7 @@ static tvbuff_t *
dissect_h265_unescap_nal_unit(tvbuff_t *tvb, packet_info *pinfo, int offset)
{
tvbuff_t *tvb_rbsp;
- int length = tvb_length_remaining(tvb, offset);
+ int length = tvb_captured_length_remaining(tvb, offset);
int NumBytesInRBSP = 0;
int i;
gchar *buff;
@@ -1789,7 +1789,7 @@ startover:
case H264_SEQ_PAR_SET: /* 7 Sequence parameter set*/
offset = dissect_h264_seq_parameter_set_rbsp(h264_nal_tree, tvb, pinfo, offset);
/* A bit ugly */
- if ((offset != -1) && (tvb_length_remaining(tvb, offset) > 0)) {
+ if ((offset != -1) && (tvb_captured_length_remaining(tvb, offset) > 0)) {
/* In this case length = offset as we start from zero */
proto_item_set_len(item, offset/*Length */);
item = proto_tree_add_item(tree, hf_h264_nal_unit, tvb, offset, -1, ENC_NA);
@@ -2055,7 +2055,7 @@ dissect_h264_par_DecoderConfigurationInformation(tvbuff_t *tvb, packet_info *pin
dissect_h264_nal_unit(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
typedef struct _h264_capability_t {
@@ -2119,7 +2119,7 @@ dissect_h264_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree, void*
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-h283.c b/epan/dissectors/packet-h283.c
index 2ebfb9e024..6714300272 100644
--- a/epan/dissectors/packet-h283.c
+++ b/epan/dissectors/packet-h283.c
@@ -297,7 +297,7 @@ dissect_h283_T_deviceListResp(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &next_tvb);
- if (next_tvb && tvb_length(next_tvb)) {
+ if (next_tvb && tvb_captured_length(next_tvb)) {
call_dissector((rdc_device_list_handle)?rdc_device_list_handle:data_handle, next_tvb, actx->pinfo, tree);
}
@@ -443,7 +443,7 @@ dissect_h283_T_rdcPDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, p
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &next_tvb);
- if (next_tvb && tvb_length(next_tvb)) {
+ if (next_tvb && tvb_captured_length(next_tvb)) {
call_dissector((rdc_pdu_handle)?rdc_pdu_handle:data_handle, next_tvb, actx->pinfo, proto_tree_get_root(tree));
}
info_is_set = TRUE;
diff --git a/epan/dissectors/packet-h450.c b/epan/dissectors/packet-h450.c
index 1c1920b9d8..00af760718 100644
--- a/epan/dissectors/packet-h450.c
+++ b/epan/dissectors/packet-h450.c
@@ -4739,12 +4739,12 @@ dissect_h450_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rctx->apdu_depth), " %s", p);
}
- if (op_ptr->arg_pdu && (tvb_length_remaining(tvb, offset) > 0))
+ if (op_ptr->arg_pdu && (tvb_captured_length_remaining(tvb, offset) > 0))
offset = op_ptr->arg_pdu(tvb, pinfo, tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(tree, tvb, offset, -1, "UNSUPPORTED ARGUMENT TYPE (H.450)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -4784,12 +4784,12 @@ dissect_h450_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rctx->apdu_depth), " %s", p);
}
- if (op_ptr->res_pdu && (tvb_length_remaining(tvb, offset) > 0))
+ if (op_ptr->res_pdu && (tvb_captured_length_remaining(tvb, offset) > 0))
offset = op_ptr->res_pdu(tvb, pinfo, tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(tree, tvb, offset, -1, "UNSUPPORTED RESULT TYPE (H.450)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -4829,12 +4829,12 @@ dissect_h450_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), rctx->apdu_depth), " %s", p);
}
- if (err_ptr->err_pdu && (tvb_length_remaining(tvb, offset) > 0))
+ if (err_ptr->err_pdu && (tvb_captured_length_remaining(tvb, offset) > 0))
offset = err_ptr->err_pdu(tvb, pinfo, tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(tree, tvb, offset, -1, "UNSUPPORTED ERROR TYPE (H.450)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-h460.c b/epan/dissectors/packet-h460.c
index d4a63e0794..8ab0535a83 100644
--- a/epan/dissectors/packet-h460.c
+++ b/epan/dissectors/packet-h460.c
@@ -1973,7 +1973,7 @@ dissect_ies(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
if (q931_ie_handle) {
call_dissector(q931_ie_handle, tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
}
@@ -1984,7 +1984,7 @@ dissect_ras(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
if (h225_ras_handle) {
call_dissector(h225_ras_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-h501.c b/epan/dissectors/packet-h501.c
index ffecca890b..de61793f58 100644
--- a/epan/dissectors/packet-h501.c
+++ b/epan/dissectors/packet-h501.c
@@ -2535,14 +2535,14 @@ static int
dissect_h501_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, FALSE, h501_pdu_handle);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
dissect_h501_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, h501_desegment_tcp, h501_pdu_handle);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_h501 ----------------------------------------------*/
diff --git a/epan/dissectors/packet-hazelcast.c b/epan/dissectors/packet-hazelcast.c
index c7322ab7f0..6fe2302fb4 100644
--- a/epan/dissectors/packet-hazelcast.c
+++ b/epan/dissectors/packet-hazelcast.c
@@ -291,7 +291,7 @@ static int dissect_hazelcast_message(tvbuff_t *tvb, packet_info *pinfo _U_, prot
hcast_tree = proto_item_add_subtree(ti, ett_hazelcast);
}
- if (tvb_length_remaining(tvb, 0) < 13) {
+ if (tvb_captured_length_remaining(tvb, 0) < 13) {
col_set_str(pinfo->cinfo, COL_INFO, "Hazelcast too short");
return 0;
}
@@ -422,7 +422,7 @@ static int dissect_hazelcast_message(tvbuff_t *tvb, packet_info *pinfo _U_, prot
/*offset += valueLength;*/
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -434,7 +434,7 @@ static int dissect_hazelcast_message(tvbuff_t *tvb, packet_info *pinfo _U_, prot
static int dissect_hazelcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
tcp_dissect_pdus(tvb, pinfo, tree, hazelcast_desegment, 13, get_hazelcast_message_len, dissect_hazelcast_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_register_hazelcast(void) {
diff --git a/epan/dissectors/packet-hci_h1.c b/epan/dissectors/packet-hci_h1.c
index ebfb3e1f9c..f097e2de72 100644
--- a/epan/dissectors/packet-hci_h1.c
+++ b/epan/dissectors/packet-hci_h1.c
@@ -129,7 +129,7 @@ dissect_hci_h1(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);
}
diff --git a/epan/dissectors/packet-hci_h4.c b/epan/dissectors/packet-hci_h4.c
index 0b734af790..34e86b8fe7 100644
--- a/epan/dissectors/packet-hci_h4.c
+++ b/epan/dissectors/packet-hci_h4.c
@@ -130,7 +130,7 @@ dissect_hci_h4(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);
}
diff --git a/epan/dissectors/packet-hci_mon.c b/epan/dissectors/packet-hci_mon.c
index 210733568e..7e0e2bf518 100644
--- a/epan/dissectors/packet-hci_mon.c
+++ b/epan/dissectors/packet-hci_mon.c
@@ -180,31 +180,31 @@ dissect_hci_mon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
break;
case 0x02: /* HCI Command Packet */
call_dissector_with_data(bthci_cmd_handle, next_tvb, pinfo, tree, hci_data);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
break;
case 0x03: /* HCI Event Packet */
call_dissector_with_data(bthci_evt_handle, next_tvb, pinfo, tree, hci_data);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
break;
case 0x04: /* ACL Tx Packet */
case 0x05: /* ACL Rx Packet */
call_dissector_with_data(bthci_acl_handle, next_tvb, pinfo, tree, hci_data);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
break;
case 0x06: /* SCO Tx Packet */
case 0x07: /* SCO Rx Packet */
call_dissector_with_data(bthci_sco_handle, next_tvb, pinfo, tree, hci_data);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
break;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(hci_mon_tree, pinfo, &ei_unknown_data, tvb, offset, -1);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
/* NOTE: Oops... HCI_MON have special packet with length 0, but there is a pseudo-header with certain infos,
diff --git a/epan/dissectors/packet-hci_usb.c b/epan/dissectors/packet-hci_usb.c
index f8527cd4aa..fd94cd9080 100644
--- a/epan/dissectors/packet-hci_usb.c
+++ b/epan/dissectors/packet-hci_usb.c
@@ -215,7 +215,7 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
fragment_add_seq_check(&hci_usb_reassembly_table,
tvb, offset, pinfo, session_id, NULL,
- fragment_info->fragment_id, tvb_length_remaining(tvb, offset), (fragment_info->remaining_length == 0) ? FALSE : TRUE);
+ fragment_info->fragment_id, tvb_captured_length_remaining(tvb, offset), (fragment_info->remaining_length == 0) ? FALSE : TRUE);
if (fragment_info->remaining_length > 0)
fragment_info->fragment_id += 1;
else
@@ -262,7 +262,7 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(ttree, hf_bthci_usb_data, tvb, offset, -1, ENC_NA);
}
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
pinfo->p2p_dir = p2p_dir_save;
diff --git a/epan/dissectors/packet-hdfs.c b/epan/dissectors/packet-hdfs.c
index 44546131c4..0a7d1082a4 100644
--- a/epan/dissectors/packet-hdfs.c
+++ b/epan/dissectors/packet-hdfs.c
@@ -652,7 +652,7 @@ dissect_hdfs_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* determine PDU length of protocol */
@@ -681,7 +681,7 @@ dissect_hdfs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
tcp_dissect_pdus(tvb, pinfo, tree, need_reassemble, frame_header_len, get_hdfs_message_len, dissect_hdfs_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* registers the protcol with the given names */
diff --git a/epan/dissectors/packet-hdfsdata.c b/epan/dissectors/packet-hdfsdata.c
index 7545be2d8e..439e273338 100644
--- a/epan/dissectors/packet-hdfsdata.c
+++ b/epan/dissectors/packet-hdfsdata.c
@@ -486,7 +486,7 @@ dissect_hdfsdata_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -523,7 +523,7 @@ dissect_hdfsdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
tcp_dissect_pdus(tvb, pinfo, tree, need_reassemble, frame_header_len, get_hdfsdata_message_len, dissect_hdfsdata_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* registers the protcol with the given names */
diff --git a/epan/dissectors/packet-hip.c b/epan/dissectors/packet-hip.c
index b273f17109..08a015bce3 100644
--- a/epan/dissectors/packet-hip.c
+++ b/epan/dissectors/packet-hip.c
@@ -553,7 +553,7 @@ dissect_hip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
/* Begin TLV parsing */
if (offset < length) {
ti_tlv = proto_tree_add_text(hip_tree, tvb, offset,
- tvb_length(tvb), "HIP Parameters");
+ tvb_captured_length(tvb), "HIP Parameters");
hip_tlv_tree = proto_item_add_subtree(ti_tlv, ett_hip_tlv);
}
/* Parse type and length in TLV */
diff --git a/epan/dissectors/packet-hnbap.c b/epan/dissectors/packet-hnbap.c
index 5b5bec4b8e..21e9791b10 100644
--- a/epan/dissectors/packet-hnbap.c
+++ b/epan/dissectors/packet-hnbap.c
@@ -2592,46 +2592,46 @@ static void dissect_HNBAP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
#if 0
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
#endif
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/epan/dissectors/packet-homeplug-av.c b/epan/dissectors/packet-homeplug-av.c
index 9d9f2506fe..3dbef7e78d 100644
--- a/epan/dissectors/packet-homeplug-av.c
+++ b/epan/dissectors/packet-homeplug-av.c
@@ -1192,7 +1192,7 @@ static const value_string homeplug_av_coupling_vals[] = {
#define TVB_LEN_GREATEST 1
#define TVB_LEN_UNDEF 0
#define TVB_LEN_SHORTEST -1
-static int check_tvb_length(ptvcursor_t *cursor, const gint length)
+static int check_tvb_captured_length(ptvcursor_t *cursor, const gint length)
{
if (!cursor)
return TVB_LEN_UNDEF;
@@ -3209,7 +3209,7 @@ dissect_homeplug_av(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
cursor = ptvcursor_new(homeplug_av_tree, tvb, 0);
/* Check if we have enough data to process the header */
- if (check_tvb_length(cursor, HOMEPLUG_AV_MMHDR_LEN) != TVB_LEN_SHORTEST) {
+ if (check_tvb_captured_length(cursor, HOMEPLUG_AV_MMHDR_LEN) != TVB_LEN_SHORTEST) {
dissect_homeplug_av_mmhdr(cursor, &homeplug_av_mmver, &homeplug_av_mmtype);
diff --git a/epan/dissectors/packet-homeplug.c b/epan/dissectors/packet-homeplug.c
index 4eb8f788c9..ff992da2fd 100644
--- a/epan/dissectors/packet-homeplug.c
+++ b/epan/dissectors/packet-homeplug.c
@@ -1293,7 +1293,7 @@ static void dissect_homeplug_mme(ptvcursor_t * cursor, packet_info * pinfo)
#define TVB_LEN_GREATEST 1
#define TVB_LEN_UNDEF 0
#define TVB_LEN_SHORTEST -1
-static int check_tvb_length(ptvcursor_t *cursor, const gint length)
+static int check_tvb_captured_length(ptvcursor_t *cursor, const gint length)
{
if (!cursor)
return TVB_LEN_UNDEF;
@@ -1326,7 +1326,7 @@ dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
cursor = ptvcursor_new(homeplug_tree, tvb, 0);
/* We do not have enough data to read mctrl field stop the dissection */
- if (check_tvb_length(cursor, HOMEPLUG_MCTRL_LEN) != TVB_LEN_SHORTEST) {
+ if (check_tvb_captured_length(cursor, HOMEPLUG_MCTRL_LEN) != TVB_LEN_SHORTEST) {
dissect_homeplug_mctrl(cursor);
@@ -1339,12 +1339,12 @@ dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
for (; homeplug_ne > 0; homeplug_ne--) {
/* Check we have enough data in tvb to read MEHDR */
- if (check_tvb_length(cursor, HOMEPLUG_MEHDR_LEN) == TVB_LEN_SHORTEST)
+ if (check_tvb_captured_length(cursor, HOMEPLUG_MEHDR_LEN) == TVB_LEN_SHORTEST)
break;
dissect_homeplug_mehdr(cursor);
/* Check we have enough data in tvb to read MELEN */
- if (check_tvb_length(cursor, HOMEPLUG_MELEN_LEN) == TVB_LEN_SHORTEST)
+ if (check_tvb_captured_length(cursor, HOMEPLUG_MELEN_LEN) == TVB_LEN_SHORTEST)
break;
dissect_homeplug_melen(cursor);
diff --git a/epan/dissectors/packet-hpext.c b/epan/dissectors/packet-hpext.c
index ef5b15cb61..389a79818c 100644
--- a/epan/dissectors/packet-hpext.c
+++ b/epan/dissectors/packet-hpext.c
@@ -93,7 +93,7 @@ dissect_hpext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(dxsap, xsap_vals, "%04x"),
val_to_str(sxsap, xsap_vals, "%04x"));
- if (tvb_length_remaining(tvb, 7) > 0) {
+ if (tvb_captured_length_remaining(tvb, 7) > 0) {
next_tvb = tvb_new_subset_remaining(tvb, 7);
if (!dissector_try_uint(subdissector_table,
dxsap, next_tvb, pinfo, tree)) {
diff --git a/epan/dissectors/packet-hpfeeds.c b/epan/dissectors/packet-hpfeeds.c
index 151b590396..ccb7b33c20 100644
--- a/epan/dissectors/packet-hpfeeds.c
+++ b/epan/dissectors/packet-hpfeeds.c
@@ -303,7 +303,7 @@ dissect_hpfeeds_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -315,7 +315,7 @@ dissect_hpfeeds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
tcp_dissect_pdus(tvb, pinfo, tree, hpfeeds_desegment, HPFEEDS_HDR_LEN,
get_hpfeeds_pdu_len, dissect_hpfeeds_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-hpsw.c b/epan/dissectors/packet-hpsw.c
index e909609e2e..3802c71924 100644
--- a/epan/dissectors/packet-hpsw.c
+++ b/epan/dissectors/packet-hpsw.c
@@ -255,7 +255,7 @@ dissect_hpsw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
length = tvb_get_guint8(tvb, offset+1);
/* make sure still in valid tlv */
- if (( length < 1 ) || ( length > tvb_length_remaining(tvb, offset+2)))
+ if (( length < 1 ) || ( length > tvb_captured_length_remaining(tvb, offset+2)))
break;
ti = proto_tree_add_text(hp_tree, tvb, offset, length+2, "%s",
diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c
index c63c0580ec..2a91e78c01 100644
--- a/epan/dissectors/packet-hsrp.c
+++ b/epan/dissectors/packet-hsrp.c
@@ -590,7 +590,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_register_hsrp(void)
diff --git a/epan/dissectors/packet-http-urlencoded.c b/epan/dissectors/packet-http-urlencoded.c
index a3ff4cf8bf..09cbe2e78d 100644
--- a/epan/dissectors/packet-http-urlencoded.c
+++ b/epan/dissectors/packet-http-urlencoded.c
@@ -185,7 +185,7 @@ dissect_form_urlencoded(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
proto_item_set_len(ti, offset - start_offset);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 13abd2c9d1..b182883d6d 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -1137,7 +1137,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
reported_datalen = tvb_reported_length_remaining(tvb, offset);
- datalen = tvb_length_remaining(tvb, offset);
+ datalen = tvb_captured_length_remaining(tvb, offset);
/*
* If a content length was supplied, the amount of data to be
@@ -1333,17 +1333,17 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
g_ascii_strcasecmp(headers.content_encoding, "x-deflate") == 0))
{
uncomp_tvb = tvb_child_uncompress(tvb, next_tvb, 0,
- tvb_length(next_tvb));
+ tvb_captured_length(next_tvb));
}
/*
* Add the encoded entity to the protocol tree
*/
e_ti = proto_tree_add_text(http_tree, next_tvb,
- 0, tvb_length(next_tvb),
+ 0, tvb_captured_length(next_tvb),
"Content-encoded entity body (%s): %u bytes",
headers.content_encoding,
- tvb_length(next_tvb));
+ tvb_captured_length(next_tvb));
e_tree = proto_item_add_subtree(e_ti,
ett_http_encoded_entity);
@@ -1359,7 +1359,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
*
tvb_free(next_tvb);
*/
- proto_item_append_text(e_ti, " -> %u bytes", tvb_length(uncomp_tvb));
+ proto_item_append_text(e_ti, " -> %u bytes", tvb_captured_length(uncomp_tvb));
next_tvb = uncomp_tvb;
add_new_data_source(pinfo, next_tvb,
"Uncompressed entity body");
@@ -1385,7 +1385,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
eo_info->hostname = conv_data->http_host;
eo_info->filename = conv_data->request_uri;
eo_info->content_type = headers.content_type;
- eo_info->payload_len = tvb_length(next_tvb);
+ eo_info->payload_len = tvb_captured_length(next_tvb);
eo_info->payload_data = tvb_get_ptr(next_tvb, 0, eo_info->payload_len);
tap_queue_packet(http_eo_tap, pinfo, eo_info);
@@ -1709,7 +1709,7 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
raw_len = 0;
if (new_tvb != NULL) {
- raw_len = tvb_length_remaining(new_tvb, 0);
+ raw_len = tvb_captured_length_remaining(new_tvb, 0);
tvb_memcpy(new_tvb, raw_data, 0, raw_len);
tvb_free(new_tvb);
@@ -2787,7 +2787,7 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
diff --git a/epan/dissectors/packet-i2c.c b/epan/dissectors/packet-i2c.c
index 133718722d..19bdb6e254 100644
--- a/epan/dissectors/packet-i2c.c
+++ b/epan/dissectors/packet-i2c.c
@@ -194,7 +194,7 @@ dissect_i2c(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
is_event = pinfo->pseudo_header->i2c.is_event;
flags = pinfo->pseudo_header->i2c.flags;
bus = pinfo->pseudo_header->i2c.bus;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (is_event) {
addr = 0;
} else {
diff --git a/epan/dissectors/packet-iapp.c b/epan/dissectors/packet-iapp.c
index 51cb56c8bf..0ba56855db 100644
--- a/epan/dissectors/packet-iapp.c
+++ b/epan/dissectors/packet-iapp.c
@@ -442,7 +442,7 @@ dissect_iapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (pdutree)
{
dissect_pdus(tvb, 2, pdutree,
- tvb_length_remaining(tvb, 2));
+ tvb_captured_length_remaining(tvb, 2));
}
}
}
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index dd60ab58b3..7ab22eeb08 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1999,7 +1999,7 @@ static guint32 dissect_trunkcall_ts(tvbuff_t *tvb, guint32 offset, proto_tree *i
*scallno = tvb_get_ntohs(tvb, offset + 2);
ts = tvb_get_ntohs(tvb, offset + 4);
- rlen = MIN(tvb_length(tvb) - offset - 6, datalen);
+ rlen = MIN(tvb_captured_length(tvb) - offset - 6, datalen);
if (iax2_tree) {
call_item = proto_tree_add_text(iax2_tree, tvb, offset, rlen + 6, "Trunk call from %u, ts: %u", *scallno, ts);
@@ -2032,7 +2032,7 @@ static guint32 dissect_trunkcall_nots(tvbuff_t *tvb, guint32 offset, proto_tree
*scallno = tvb_get_ntohs(tvb, offset);
datalen = tvb_get_ntohs(tvb, offset + 2);
- rlen = MIN(tvb_length(tvb) - offset - 4, datalen);
+ rlen = MIN(tvb_captured_length(tvb) - offset - 4, datalen);
if (iax2_tree) {
call_item = proto_tree_add_text(iax2_tree, tvb, offset, rlen + 6, "Trunk call from %u", *scallno);
@@ -2131,7 +2131,7 @@ static guint32 dissect_trunkpacket(tvbuff_t *tvb, guint32 offset,
if (trunkts) {
/* Trunk calls with timestamp */
- while(tvb_length_remaining(tvb, offset) >= 6) {
+ while(tvb_captured_length_remaining(tvb, offset) >= 6) {
guint16 scallno;
offset = dissect_trunkcall_ts(tvb, offset, iax2_tree, &scallno);
if (!call_list_find(calls, scallno)) {
@@ -2142,7 +2142,7 @@ static guint32 dissect_trunkpacket(tvbuff_t *tvb, guint32 offset,
}
else {
/* Trunk calls without timestamp */
- while(tvb_length_remaining(tvb, offset) >= 4) {
+ while(tvb_captured_length_remaining(tvb, offset) >= 4) {
guint16 scallno;
offset = dissect_trunkcall_nots(tvb, offset, iax2_tree, &scallno);
if (!call_list_find(calls, scallno)) {
diff --git a/epan/dissectors/packet-icap.c b/epan/dissectors/packet-icap.c
index 56d1324048..6393270476 100644
--- a/epan/dissectors/packet-icap.c
+++ b/epan/dissectors/packet-icap.c
@@ -247,7 +247,7 @@ is_icap_header:
}
}
- datalen = tvb_length_remaining(tvb, offset);
+ datalen = tvb_captured_length_remaining(tvb, offset);
if (datalen > 0) {
call_dissector(data_handle,
tvb_new_subset_remaining(tvb, offset), pinfo, icap_tree);
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c
index a59e85b453..6a3049257e 100644
--- a/epan/dissectors/packet-icep.c
+++ b/epan/dissectors/packet-icep.c
@@ -891,7 +891,7 @@ static void dissect_icep_reply(tvbuff_t *tvb, guint32 offset,
DBG1("consumed --> %d\n", 5);
/* check if I got all reply data */
- tvb_data_remained = tvb_length_remaining(tvb, offset);
+ tvb_data_remained = tvb_captured_length_remaining(tvb, offset);
messageSize = tvb_get_letohl(tvb, 10);
reported_reply_data = messageSize - (ICEP_HEADER_SIZE + ICEP_MIN_REPLY_SIZE);
@@ -1001,17 +1001,17 @@ static int dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
switch(tvb_get_guint8(tvb, 8)) {
case 0x0:
DBG1("request message body: parsing %d bytes\n",
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
dissect_icep_request(tvb, offset, pinfo, icep_tree, ti);
break;
case 0x1:
DBG1("batch request message body: parsing %d bytes\n",
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
dissect_icep_batch_request(tvb, offset, pinfo, icep_tree, ti);
break;
case 0x2:
DBG1("reply message body: parsing %d bytes\n",
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
dissect_icep_reply(tvb, offset, pinfo, icep_tree, ti);
break;
case 0x3:
@@ -1022,7 +1022,7 @@ static int dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
expert_add_info_format(pinfo, msg_item, &ei_icep_message_type, "Unknown Message Type: 0x%02x", tvb_get_guint8(tvb, 8));
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* entry point */
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c
index 1f7b8bbc62..2e35380b43 100644
--- a/epan/dissectors/packet-icmp.c
+++ b/epan/dissectors/packet-icmp.c
@@ -1352,7 +1352,7 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data)
col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", code_str);
}
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
ti = proto_tree_add_item(tree, proto_icmp, tvb, 0, length, ENC_NA);
@@ -1603,8 +1603,8 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data)
/* Make sure we have enough bytes in the payload before trying to
* see if the data looks like a timestamp; otherwise we'll get
* malformed packets as we try to access data that isn't there. */
- if (tvb_length_remaining(tvb, 8) < 8) {
- if (tvb_length_remaining(tvb, 8) > 0) {
+ if (tvb_captured_length_remaining(tvb, 8) < 8) {
+ if (tvb_captured_length_remaining(tvb, 8) > 0) {
call_dissector(data_handle,
tvb_new_subset_remaining
(tvb, 8), pinfo, icmp_tree);
@@ -1720,7 +1720,7 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data)
tap_queue_packet(icmp_tap, pinfo, trans);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_register_icmp(void)
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c
index a8d99090fe..7d3c450731 100644
--- a/epan/dissectors/packet-icmpv6.c
+++ b/epan/dissectors/packet-icmpv6.c
@@ -3281,7 +3281,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
cksum = tvb_get_ntohs(tvb, offset);
if (1) { /* There's an expert info in here so always execute */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
if (!pinfo->fragmented && length >= reported_length) {
/* The packet isn't part of a fragmented datagram and isn't
diff --git a/epan/dissectors/packet-icq.c b/epan/dissectors/packet-icq.c
index 26b0104558..f6788babad 100644
--- a/epan/dissectors/packet-icq.c
+++ b/epan/dissectors/packet-icq.c
@@ -1093,7 +1093,7 @@ dissect_icqv5Client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *decr_tvb;
pktsize = tvb_reported_length(tvb);
- capturedsize = tvb_length(tvb);
+ capturedsize = tvb_captured_length(tvb);
/* Get the encryption key */
code = tvb_get_letohl(tvb, ICQ5_CL_CHECKCODE);
@@ -1305,7 +1305,7 @@ dissect_icq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
proto_tree_add_item(icq_tree, hf_icq_version, tvb, ICQ_VERSION, 2, ENC_LITTLE_ENDIAN);
}
- return (tvb_length(tvb));
+ return (tvb_captured_length(tvb));
}
/* registration with the filtering engine */
diff --git a/epan/dissectors/packet-idmp.c b/epan/dissectors/packet-idmp.c
index 11ee9594cb..f27c393b55 100644
--- a/epan/dissectors/packet-idmp.c
+++ b/epan/dissectors/packet-idmp.c
@@ -716,7 +716,7 @@ static int dissect_idmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
dissect_idmp_IDM_PDU(FALSE, tvb, offset, &asn1_ctx, tree, hf_idmp_PDU);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
@@ -731,7 +731,7 @@ static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
static int dissect_idmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, parent_tree, idmp_desegment, 0, get_idmp_pdu_len, dissect_idmp, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void idmp_reassemble_init (void)
diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c
index 9afac8d5d2..f4feffd6ec 100644
--- a/epan/dissectors/packet-iec104.c
+++ b/epan/dissectors/packet-iec104.c
@@ -1038,7 +1038,7 @@ static void get_QOI(tvbuff_t *tvb, guint8 *offset, proto_tree *iec104_header_tre
/* Find the APDU 104 (APDU=APCI+ASDU) length.
-Includes possible tvb_length-1 bytes that don't form an APDU */
+Includes possible tvb_captured_length-1 bytes that don't form an APDU */
static guint get_iec104apdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
guint8 Val;
@@ -1409,7 +1409,7 @@ static int dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if (len < APDU_MIN_LEN) {
expert_add_info_format(pinfo, ti, &ei_iec104_apdu_min_len, "APDU less than %d bytes", APDU_MIN_LEN);
wmem_strbuf_append_printf(res, "<ERR ApduLen=%u bytes> ", len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
temp8 = tvb_get_guint8(tvb, Off + 2);
@@ -1467,7 +1467,7 @@ static int dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree_add_item(it104tree, hf_apcidata, tvb, 0, Off, ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_iec104reas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
@@ -1477,7 +1477,7 @@ static int dissect_iec104reas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
*/
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, APCI_LEN,
get_iec104apdu_len, dissect_iec104apci, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* The protocol has two subprotocols: Register APCI */
diff --git a/epan/dissectors/packet-ieee17221.c b/epan/dissectors/packet-ieee17221.c
index 3a2e30761b..860ccdd0ea 100644
--- a/epan/dissectors/packet-ieee17221.c
+++ b/epan/dissectors/packet-ieee17221.c
@@ -3794,7 +3794,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
default:
proto_tree_add_item(aem_tree, hf_aem_unknown_descriptor, tvb,
- 4, tvb_length(tvb) - 4, ENC_NA);
+ 4, tvb_captured_length(tvb) - 4, ENC_NA);
break;
}
}
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c
index 868df594fa..012b8c9957 100644
--- a/epan/dissectors/packet-ieee80211-radiotap.c
+++ b/epan/dissectors/packet-ieee80211-radiotap.c
@@ -1941,11 +1941,11 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
* take that into account by using the FCS length recorded in pinfo. */
/* Watch out for [erroneously] short frames */
- if (tvb_length(next_tvb) >
+ if (tvb_captured_length(next_tvb) >
(unsigned int)pinfo->pseudo_header->ieee_802_11.fcs_len) {
calc_fcs =
crc32_802_tvb(next_tvb,
- tvb_length(next_tvb) -
+ tvb_captured_length(next_tvb) -
pinfo->pseudo_header->ieee_802_11.fcs_len);
/* By virtue of hdr_fcs_ti being set, we know that 'tree' is set,
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 01d0072dcd..daae48d79b 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -9806,7 +9806,7 @@ static void dissect_hs20_indication(proto_tree *tree, tvbuff_t *tvb,
static void
dissect_vendor_ie_wfa(packet_info *pinfo, proto_item *item, tvbuff_t *tag_tvb)
{
- gint tag_len = tvb_length(tag_tvb);
+ gint tag_len = tvb_captured_length(tag_tvb);
if (tag_len < 4)
return;
@@ -15874,7 +15874,7 @@ dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
DATA_FRAME_IS_QOS(frame_type_subtype)) {
qosoff = hdr_len - htc_len - 2;
qos_control = tvb_get_letohs(tvb, qosoff);
- if (tvb_length(tvb) > hdr_len) {
+ if (tvb_captured_length(tvb) > hdr_len) {
meshoff = hdr_len;
mesh_flags = tvb_get_guint8 (tvb, hdr_len);
if (has_mesh_control(fcf, qos_control, mesh_flags)) {
@@ -16155,7 +16155,7 @@ dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
tvb, offset, 1, ENC_NA);
offset++;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
sta_info_item = proto_tree_add_item(hdr_tree, hf_ieee80211_vht_ndp_annc_sta_info,
tvb, offset, 2, ENC_NA);
sta_info_tree = proto_item_add_subtree(sta_info_item, ett_vht_ndp_annc_sta_info_tree);
@@ -16775,7 +16775,7 @@ dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
}
}
- len = tvb_length_remaining(tvb, hdr_len);
+ len = tvb_captured_length_remaining(tvb, hdr_len);
reported_len = tvb_reported_length_remaining(tvb, hdr_len);
switch (fcs_len)
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index 86c32662b4..52184f5f7a 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -481,14 +481,14 @@ dissect_ieee802154_nonask_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* Create the protocol tree. */
if (tree) {
- proto_root = proto_tree_add_protocol_format(tree, proto_ieee802154_nonask_phy, tvb, 0, tvb_length(tvb), "IEEE 802.15.4 non-ASK PHY");
+ proto_root = proto_tree_add_protocol_format(tree, proto_ieee802154_nonask_phy, tvb, 0, tvb_captured_length(tvb), "IEEE 802.15.4 non-ASK PHY");
ieee802154_tree = proto_item_add_subtree(proto_root, ett_ieee802154_nonask_phy);
}
/* Add the protocol name. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IEEE 802.15.4 non-ASK PHY");
/* Add the packet length. */
- col_add_fstr(pinfo->cinfo, COL_PACKET_LENGTH, "%i", tvb_length(tvb));
+ col_add_fstr(pinfo->cinfo, COL_PACKET_LENGTH, "%i", tvb_captured_length(tvb));
preamble=tvb_get_letohl(tvb,offset);
sfd=tvb_get_guint8(tvb,offset+4);
@@ -650,13 +650,13 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
/* Create the protocol tree. */
if (tree) {
- proto_root = proto_tree_add_protocol_format(tree, proto_ieee802154, tvb, 0, tvb_length(tvb), "IEEE 802.15.4");
+ proto_root = proto_tree_add_protocol_format(tree, proto_ieee802154, tvb, 0, tvb_captured_length(tvb), "IEEE 802.15.4");
ieee802154_tree = proto_item_add_subtree(proto_root, ett_ieee802154);
}
/* Add the protocol name. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IEEE 802.15.4");
/* Add the packet length. */
- col_add_fstr(pinfo->cinfo, COL_PACKET_LENGTH, "%i", tvb_length(tvb));
+ col_add_fstr(pinfo->cinfo, COL_PACKET_LENGTH, "%i", tvb_captured_length(tvb));
/* Add the packet length to the filter field */
hidden_item = proto_tree_add_uint(ieee802154_tree, hf_ieee802154_frame_length, NULL, 0, 0, tvb_reported_length(tvb));
@@ -1012,7 +1012,7 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
if (!payload_tvb) {
/* Deal with possible truncation and the FCS field at the end. */
gint reported_len = tvb_reported_length(tvb)-offset-IEEE802154_FCS_LEN;
- gint captured_len = tvb_length(tvb)-offset;
+ gint captured_len = tvb_captured_length(tvb)-offset;
if (reported_len < captured_len) captured_len = reported_len;
payload_tvb = tvb_new_subset(tvb, offset, captured_len, reported_len);
}
@@ -1067,7 +1067,7 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
else {
/* Deal with possible truncation and the FCS field at the end. */
gint reported_len = tvb_reported_length(tvb)-offset-IEEE802154_FCS_LEN;
- gint captured_len = tvb_length(tvb)-offset;
+ gint captured_len = tvb_captured_length(tvb)-offset;
if (reported_len < captured_len) captured_len = reported_len;
payload_tvb = tvb_new_subset(tvb, offset, captured_len, reported_len);
}
@@ -1412,7 +1412,7 @@ dissect_ieee802154_assoc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
/* Call the data dissector for any leftover bytes. */
- if (tvb_length(tvb) > 1) {
+ if (tvb_captured_length(tvb) > 1) {
call_dissector(data_handle, tvb_new_subset_remaining(tvb, 1), pinfo, tree);
}
} /* dissect_ieee802154_assoc_req */
@@ -1488,7 +1488,7 @@ dissect_ieee802154_assoc_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
/* Call the data dissector for any leftover bytes. */
- if (tvb_length(tvb) > offset) {
+ if (tvb_captured_length(tvb) > offset) {
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
} /* dissect_ieee802154_assoc_rsp */
@@ -1549,7 +1549,7 @@ dissect_ieee802154_disassoc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Call the data dissector for any leftover bytes. */
- if (tvb_length(tvb) > 1) {
+ if (tvb_captured_length(tvb) > 1) {
call_dissector(data_handle, tvb_new_subset_remaining(tvb, 1), pinfo, tree);
}
} /* dissect_ieee802154_disassoc */
@@ -1631,7 +1631,7 @@ dissect_ieee802154_realign(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Call the data dissector for any leftover bytes. */
- if (tvb_length(tvb) > offset) {
+ if (tvb_captured_length(tvb) > offset) {
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
} /* dissect_ieee802154_realign */
@@ -1690,7 +1690,7 @@ dissect_ieee802154_gtsreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
}
/* Call the data dissector for any leftover bytes. */
- if (tvb_length(tvb) > 1) {
+ if (tvb_captured_length(tvb) > 1) {
call_dissector(data_handle, tvb_new_subset_remaining(tvb, 1), pinfo, tree);
}
} /* dissect_ieee802154_gtsreq */
@@ -1853,7 +1853,7 @@ dissect_ieee802154_decrypt(tvbuff_t *tvb, guint offset, packet_info *pinfo, ieee
captured_len = reported_len;
}
else {
- captured_len = tvb_length_remaining(tvb, offset);
+ captured_len = tvb_captured_length_remaining(tvb, offset);
}
/* Check if the MIC is present in the captured data. */
diff --git a/epan/dissectors/packet-ieee8023.c b/epan/dissectors/packet-ieee8023.c
index c5aac88891..6f06f684b5 100644
--- a/epan/dissectors/packet-ieee8023.c
+++ b/epan/dissectors/packet-ieee8023.c
@@ -70,7 +70,7 @@ dissect_802_3(volatile int length, gboolean is_802_2, tvbuff_t *tvb,
}
/* Give the next dissector only 'length' number of bytes. */
- captured_length = tvb_length_remaining(tvb, offset_after_length);
+ captured_length = tvb_captured_length_remaining(tvb, offset_after_length);
if (captured_length > length)
captured_length = length;
next_tvb = tvb_new_subset(tvb, offset_after_length, captured_length, length);
diff --git a/epan/dissectors/packet-ifcp.c b/epan/dissectors/packet-ifcp.c
index 8f253f50f5..101da7501e 100644
--- a/epan/dissectors/packet-ifcp.c
+++ b/epan/dissectors/packet-ifcp.c
@@ -158,7 +158,7 @@ ifcp_header_test(tvbuff_t *tvb, int offset)
guint16 flen, flen1;
/* we can only do this test if we have 16 bytes or more */
- if(tvb_length_remaining(tvb, offset)<iFCP_MIN_HEADER_LEN){
+ if(tvb_captured_length_remaining(tvb, offset)<iFCP_MIN_HEADER_LEN){
return FALSE;
}
@@ -326,7 +326,7 @@ dissect_ifcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
fc_data_t fc_data;
/* verify we have a full header (do we need to do this? */
- if(tvb_length(tvb)<iFCP_ENCAP_HEADER_LEN){
+ if(tvb_captured_length(tvb)<iFCP_ENCAP_HEADER_LEN){
return 0;
}
@@ -496,7 +496,7 @@ dissect_ifcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
call_dissector(data_handle, next_tvb, pinfo, parent_tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -516,7 +516,7 @@ static int
dissect_ifcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, parent_tree, ifcp_desegment, iFCP_MIN_HEADER_LEN, get_ifcp_pdu_len, dissect_ifcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-igap.c b/epan/dissectors/packet-igap.c
index 7a478b2cfd..d73e844572 100644
--- a/epan/dissectors/packet-igap.c
+++ b/epan/dissectors/packet-igap.c
@@ -137,7 +137,7 @@ dissect_igap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int off
/* 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_igap, tvb, offset, -1, ENC_NA);
diff --git a/epan/dissectors/packet-igmp.c b/epan/dissectors/packet-igmp.c
index 68fef8a42a..13dee70e31 100644
--- a/epan/dissectors/packet-igmp.c
+++ b/epan/dissectors/packet-igmp.c
@@ -341,7 +341,7 @@ void igmp_checksum(proto_tree *tree, tvbuff_t *tvb, int hf_index,
}
hdrcksum = tvb_get_ntohs(tvb, 2);
- if (!pinfo->fragmented && tvb_length(tvb) >= len) {
+ if (!pinfo->fragmented && tvb_captured_length(tvb) >= len) {
/*
* The packet isn't part of a fragmented datagram and isn't
* truncated, so we can checksum it.
@@ -383,7 +383,7 @@ dissect_igmp_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int ty
offset += 1;
/* Just call the rest of it "data" */
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
proto_tree_add_text(tree, tvb, offset, len, "Data");
offset += len;
diff --git a/epan/dissectors/packet-ilp.c b/epan/dissectors/packet-ilp.c
index 96af28495d..0e405d5023 100644
--- a/epan/dissectors/packet-ilp.c
+++ b/epan/dissectors/packet-ilp.c
@@ -4105,7 +4105,7 @@ dissect_ilp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, ilp_desegment, ILP_HEADER_SIZE,
get_ilp_pdu_len, dissect_ILP_PDU_PDU, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_reg_handoff_ilp(void);
diff --git a/epan/dissectors/packet-imap.c b/epan/dissectors/packet-imap.c
index 0b9d029668..3d2c861a71 100644
--- a/epan/dissectors/packet-imap.c
+++ b/epan/dissectors/packet-imap.c
@@ -116,7 +116,7 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hidden_item = proto_tree_add_boolean(imap_tree, hf_imap_isrequest, tvb, 0, 0, is_request);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
/*
* Find the end of each line
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c
index 102b9f9aeb..238bc7c12f 100644
--- a/epan/dissectors/packet-imf.c
+++ b/epan/dissectors/packet-imf.c
@@ -702,7 +702,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tree = proto_item_add_subtree(item, ett_imf);
}
- max_length = tvb_length(tvb);
+ max_length = tvb_captured_length(tvb);
/* first go through the tvb until we find a blank line and extract the content type if
we find one */
diff --git a/epan/dissectors/packet-inap.c b/epan/dissectors/packet-inap.c
index f51d72d441..b503bd2d96 100644
--- a/epan/dissectors/packet-inap.c
+++ b/epan/dissectors/packet-inap.c
@@ -1521,7 +1521,7 @@ dissect_inap_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
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);
}
@@ -2206,7 +2206,7 @@ dissect_inap_T_bearerCap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
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);
@@ -4553,7 +4553,7 @@ dissect_inap_HighLayerCompatibility(gboolean implicit_tag _U_, tvbuff_t *tvb _U_
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_inap_HighLayerCompatibility);
- dissect_q931_high_layer_compat_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree);
+ dissect_q931_high_layer_compat_ie(parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), subtree);
diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c
index 0cd39cec12..ac252572ff 100644
--- a/epan/dissectors/packet-infiniband.c
+++ b/epan/dissectors/packet-infiniband.c
@@ -1527,7 +1527,7 @@ dissect_infiniband_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
struct infinibandinfo info = { 0, };
gint32 nextHeaderSequence = -1; /* defined by this dissector. #define which indicates the upcoming header sequence from OpCode */
guint8 nxtHdr = 0; /* Keyed off for header dissection order */
- guint16 packetLength = 0; /* Packet Length. We track this as tvb_length - offset. */
+ guint16 packetLength = 0; /* Packet Length. We track this as tvb_captured_length - offset. */
/* It provides the parsing methods a known size */
/* that must be available for that header. */
struct e_in6_addr SRCgid; /* Structures to hold GIDs should we need them */
@@ -2362,7 +2362,7 @@ static void parse_PAYLOAD(proto_tree *parentTree,
{
/* Calculation for Payload:
- * (tvb_length) Length of entire packet - (local_offset) Starting byte of Payload Data
+ * (tvb_captured_length) Length of entire packet - (local_offset) Starting byte of Payload Data
* offset addition is more complex for the payload.
* We need the total length of the packet, - length of previous headers, + offset where payload started.
* We also need to reserve 6 bytes for the CRCs which are not actually part of the payload. */
@@ -2392,7 +2392,7 @@ static void parse_PAYLOAD(proto_tree *parentTree,
/* Get the captured length and reported length of the data
after the Ethernet type. */
- captured_length = tvb_length_remaining(tvb, local_offset+4);
+ captured_length = tvb_captured_length_remaining(tvb, local_offset+4);
reported_length = tvb_reported_length_remaining(tvb, local_offset+4);
next_tvb = tvb_new_subset(tvb, local_offset+4, captured_length, reported_length);
@@ -2450,7 +2450,7 @@ static void parse_PAYLOAD(proto_tree *parentTree,
}
- captured_length = tvb_length_remaining(tvb, local_offset);
+ captured_length = tvb_captured_length_remaining(tvb, local_offset);
reported_length = tvb_reported_length_remaining(tvb,
local_offset);
@@ -2513,7 +2513,7 @@ static void parse_IPvSix(proto_tree *parentTree, tvbuff_t *tvb, gint *offset, pa
/* (- 2) for VCRC which lives at the end of the packet */
ipv6_tvb = tvb_new_subset(tvb, *offset,
- tvb_length_remaining(tvb, *offset) - 2,
+ tvb_captured_length_remaining(tvb, *offset) - 2,
tvb_reported_length_remaining(tvb, *offset) - 2);
call_dissector(ipv6_handle, ipv6_tvb, pinfo, parentTree);
*offset = tvb_reported_length(tvb) - 2;
@@ -2555,7 +2555,7 @@ static void parse_RWH(proto_tree *ah_tree, tvbuff_t *tvb, gint *offset, packet_i
/* Get the captured length and reported length of the data
* after the Ethernet type. */
- captured_length = tvb_length_remaining(tvb, *offset);
+ captured_length = tvb_captured_length_remaining(tvb, *offset);
reported_length = tvb_reported_length_remaining(tvb, *offset);
/* Construct a tvbuff for the payload after the Ethernet type,
@@ -2599,7 +2599,7 @@ static gboolean parse_EoIB(proto_tree *tree, tvbuff_t *tvb, gint offset, packet_
return FALSE;
}
- encap_tvb = tvb_new_subset(tvb, offset + 4, tvb_length_remaining(tvb, offset + 4), encap_size - 4);
+ encap_tvb = tvb_new_subset(tvb, offset + 4, tvb_captured_length_remaining(tvb, offset + 4), encap_size - 4);
header_item = proto_tree_add_item(tree, hf_infiniband_EOIB, tvb, offset, 4, ENC_NA);
header_subtree = proto_item_add_subtree(header_item, ett_eoib);
diff --git a/epan/dissectors/packet-infiniband_sdp.c b/epan/dissectors/packet-infiniband_sdp.c
index 98d8fb47d1..55393e2e65 100644
--- a/epan/dissectors/packet-infiniband_sdp.c
+++ b/epan/dissectors/packet-infiniband_sdp.c
@@ -172,7 +172,7 @@ dissect_ib_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
conversation_infiniband_data *convo_data = NULL;
dissector_handle_t infiniband_handle;
- if (tvb_length(tvb) < 16) /* check this has at least enough bytes for the BSDH */
+ if (tvb_captured_length(tvb) < 16) /* check this has at least enough bytes for the BSDH */
return 0;
if (gPREF_MAN_EN) {
@@ -315,7 +315,7 @@ manual_override:
col_append_fstr(pinfo->cinfo, COL_INFO, "(SDP %s)",
rval_to_str(mid, mid_meanings, "Unknown"));
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 5d0f35a0ed..c6c9c07c7e 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -2433,7 +2433,7 @@ dissect_ip_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if(length<4){
/* Need at least 4 bytes to make some sort of decision */
return FALSE;
diff --git a/epan/dissectors/packet-ipars.c b/epan/dissectors/packet-ipars.c
index 4de1f45ad6..e421ce0a17 100644
--- a/epan/dissectors/packet-ipars.c
+++ b/epan/dissectors/packet-ipars.c
@@ -63,21 +63,21 @@ dissect_ipars(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPARS");
- if (tvb_length_remaining(tvb, 0) >= 2 ) {
+ if (tvb_captured_length_remaining(tvb, 0) >= 2 ) {
ia = tvb_get_guint8(tvb, 0) & 0x3f;
ta = tvb_get_guint8(tvb, 1) & 0x3f;
if (ia == S1 && ta == S2) { /* if the first two bytes are S1/S2 skip over them */
offset = 2;
}
}
- if (tvb_length_remaining(tvb, offset) >= 1) ia = tvb_get_guint8(tvb, offset + 0);
- if (tvb_length_remaining(tvb, offset) >= 2) ta = tvb_get_guint8(tvb, offset + 1);
+ if (tvb_captured_length_remaining(tvb, offset) >= 1) ia = tvb_get_guint8(tvb, offset + 0);
+ if (tvb_captured_length_remaining(tvb, offset) >= 2) ta = tvb_get_guint8(tvb, offset + 1);
if (ia == 0x83 || ia == 0x43 || ia == GA) { /* if it's an FPGA or 'corresponsdance code' 'go ahead'... */
- if (tvb_length_remaining(tvb, offset) > 2) { /* if the msg is long, it must have been a 'poll' */
+ if (tvb_captured_length_remaining(tvb, offset) > 2) { /* if the msg is long, it must have been a 'poll' */
col_add_fstr(pinfo->cinfo, COL_INFO, "Poll IA: %2.2X", ta);
} else { /* if it's short, then it was a 'no traffic' response */
- if (tvb_length_remaining(tvb, offset) >= 2 ) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 2 ) {
col_add_fstr(pinfo->cinfo, COL_INFO, "GoAhead NextIA (0x%2.2X)", ta);
} else {
col_set_str(pinfo->cinfo, COL_INFO, "GoAhead NextIA");
@@ -89,8 +89,8 @@ dissect_ipars(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
if (ta == 0x20) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Reset IA: %2.2X", ia); /* the TA character was the 'reset' command */
}
- if (tvb_length_remaining(tvb, offset) >= 3) cmd = tvb_get_guint8(tvb, offset + 2) & 0x3f; /* get the first two bytes of the data message */
- if (tvb_length_remaining(tvb, offset) >= 4) la = tvb_get_guint8(tvb, offset + 3) & 0x3f;
+ if (tvb_captured_length_remaining(tvb, offset) >= 3) cmd = tvb_get_guint8(tvb, offset + 2) & 0x3f; /* get the first two bytes of the data message */
+ if (tvb_captured_length_remaining(tvb, offset) >= 4) la = tvb_get_guint8(tvb, offset + 3) & 0x3f;
if (cmd == 0x1f && la == 0x38) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Please Resend - IA: %2.2X TA: %2.2X", ia, ta); /* light the resend indicator */
} else if (cmd == 0x2a && la == 0x05) {
@@ -101,7 +101,7 @@ dissect_ipars(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
}
if (tree) {
- bytes = tvb_length_remaining(tvb, 0);
+ bytes = tvb_captured_length_remaining(tvb, 0);
if (bytes > 0) {
proto_tree *ipars_tree;
proto_item *ti;
diff --git a/epan/dissectors/packet-ipdc.c b/epan/dissectors/packet-ipdc.c
index d2845d4924..308d879555 100644
--- a/epan/dissectors/packet-ipdc.c
+++ b/epan/dissectors/packet-ipdc.c
@@ -936,7 +936,7 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
}
col_set_fence(pinfo->cinfo, COL_INFO);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -950,7 +950,7 @@ dissect_ipdc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
{
tcp_dissect_pdus(tvb, pinfo, tree, ipdc_desegment, 4,
get_ipdc_pdu_len, dissect_ipdc_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-ipnet.c b/epan/dissectors/packet-ipnet.c
index 3c8513ac58..e44311a47b 100644
--- a/epan/dissectors/packet-ipnet.c
+++ b/epan/dissectors/packet-ipnet.c
@@ -89,7 +89,7 @@ dissect_ipnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
pktlen = tvb_get_ntohl(tvb, 4);
- next_tvb = tvb_new_subset_remaining(tvb, tvb_length(tvb) - pktlen);
+ next_tvb = tvb_new_subset_remaining(tvb, tvb_captured_length(tvb) - pktlen);
family = tvb_get_guint8(tvb, 1);
switch (family) {
diff --git a/epan/dissectors/packet-ipsec-tcp.c b/epan/dissectors/packet-ipsec-tcp.c
index 8178594748..6bd02103dd 100644
--- a/epan/dissectors/packet-ipsec-tcp.c
+++ b/epan/dissectors/packet-ipsec-tcp.c
@@ -161,14 +161,14 @@ dissect_tcpencap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
call_dissector(esp_handle, next_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
dissect_tcpencap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
guint32 reported_length = tvb_reported_length(tvb);
- guint32 length = tvb_length(tvb);
+ guint32 length = tvb_captured_length(tvb);
if (reported_length <= TRAILERLENGTH + 8 ||
/* Ensure we have enough bytes for packet_is_tcpencap analysis */
diff --git a/epan/dissectors/packet-ipsec-udp.c b/epan/dissectors/packet-ipsec-udp.c
index d2e8717638..ee9a6ba737 100644
--- a/epan/dissectors/packet-ipsec-udp.c
+++ b/epan/dissectors/packet-ipsec-udp.c
@@ -57,7 +57,7 @@ dissect_udpencap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* 1 byte of 0xFF indicates NAT-keepalive */
- if ((tvb_length(tvb) == 1) && (tvb_get_guint8(tvb, 0) == 0xff)) {
+ if ((tvb_captured_length(tvb) == 1) && (tvb_get_guint8(tvb, 0) == 0xff)) {
col_set_str(pinfo->cinfo, COL_INFO, "NAT-keepalive");
if (tree)
proto_tree_add_text(udpencap_tree, tvb, 0, 1, "NAT-keepalive packet");
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index 3576b146c0..5e19f94dfb 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -1145,7 +1145,7 @@ dissect_esp_authentication(proto_tree *tree, tvbuff_t *tvb, gint len, gint esp_a
else
{
/* Truncated so just display what we have */
- item = proto_tree_add_text(tree, tvb, len - esp_auth_len, esp_auth_len - (len - tvb_length(tvb)),
+ item = proto_tree_add_text(tree, tvb, len - esp_auth_len, esp_auth_len - (len - tvb_captured_length(tvb)),
"Authentication Data (truncated)");
bad = TRUE;
}
@@ -1296,7 +1296,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(get_address_ok)
{
/* Get the SPI */
- if (tvb_length(tvb) >= 4)
+ if (tvb_captured_length(tvb) >= 4)
{
spi = tvb_get_ntohl(tvb, 0);
}
@@ -2087,7 +2087,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
/* Truncated so just display what we have */
- proto_tree_add_text(esp_tree, tvb, len - 12, 12 - (len - tvb_length(tvb)),
+ proto_tree_add_text(esp_tree, tvb, len - 12, 12 - (len - tvb_captured_length(tvb)),
"Authentication Data (truncated)");
}
}
@@ -2154,7 +2154,7 @@ dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* CPIs, we don't know the algorithm beforehand; if we get it
* wrong, tvb_uncompress() returns NULL and nothing is displayed.
*/
- decomp = tvb_child_uncompress(data, data, 0, tvb_length(data));
+ decomp = tvb_child_uncompress(data, data, 0, tvb_captured_length(data));
if (decomp) {
add_new_data_source(pinfo, decomp, "IPcomp inflated data");
saved_match_uint = pinfo->match_uint;
diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c
index b845bdf3c9..a3335b3b1f 100644
--- a/epan/dissectors/packet-ipx.c
+++ b/epan/dissectors/packet-ipx.c
@@ -788,7 +788,7 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, 0, 0, spx_rexmit_info_p->num,
"This is a retransmission of frame %u",
spx_rexmit_info_p->num);
- if (tvb_length_remaining(tvb, hdr_len) > 0) {
+ if (tvb_captured_length_remaining(tvb, hdr_len) > 0) {
proto_tree_add_text(spx_tree, tvb,
hdr_len, -1,
"Retransmitted data");
diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c
index 4f18eaa60d..1a1ce26e71 100644
--- a/epan/dissectors/packet-isakmp.c
+++ b/epan/dissectors/packet-isakmp.c
@@ -1896,7 +1896,7 @@ decrypt_payload(tvbuff_t *tvb, packet_info *pinfo, const guint8 *buf, guint buf_
add_new_data_source(pinfo, encr_tvb, "Decrypted IKE");
/* Fill in the next IV */
- if (tvb_length(tvb) > cbc_block_size) {
+ if (tvb_captured_length(tvb) > cbc_block_size) {
decr->last_cbc_len = cbc_block_size;
memcpy(decr->last_cbc, buf + buf_len - cbc_block_size, cbc_block_size);
} else {
@@ -2949,7 +2949,7 @@ dissect_isakmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (decr_tvb) {
decr_tree = proto_item_add_subtree(ti, ett_isakmp);
dissect_payloads(decr_tvb, decr_tree, tree, isakmp_version,
- hdr.next_payload, 0, tvb_length(decr_tvb), pinfo, decr_data);
+ hdr.next_payload, 0, tvb_captured_length(decr_tvb), pinfo, decr_data);
}
}
@@ -3893,7 +3893,7 @@ dissect_cisco_fragmentation(tvbuff_t *tvb, int offset, int length, proto_tree *t
12345, /*FIXME: Fragmented packet id, guint16, somehow get CKY here */
NULL,
seq-1, /* fragment sequence number, starting from 0 */
- tvb_length_remaining(tvb, offset), /* fragment length - to the end */
+ tvb_captured_length_remaining(tvb, offset), /* fragment length - to the end */
last); /* More fragments? */
defrag_isakmp_tvb = process_reassembled_data(tvb, offset, pinfo,
"Reassembled ISAKMP", frag_msg, &isakmp_frag_items,
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c
index 7cb68aaa1d..a18fd5efe9 100644
--- a/epan/dissectors/packet-iscsi.c
+++ b/epan/dissectors/packet-iscsi.c
@@ -633,7 +633,7 @@ addTextKeys(packet_info *pinfo, proto_tree *tt, tvbuff_t *tvb, gint offset, guin
static gint
handleHeaderDigest(iscsi_session_t *iscsi_session, proto_item *ti, tvbuff_t *tvb, guint offset, int headerLen) {
- int available_bytes = tvb_length_remaining(tvb, offset);
+ int available_bytes = tvb_captured_length_remaining(tvb, offset);
switch(iscsi_session->header_digest){
case ISCSI_HEADER_DIGEST_CRC32:
@@ -653,7 +653,7 @@ handleHeaderDigest(iscsi_session_t *iscsi_session, proto_item *ti, tvbuff_t *tvb
static gint
handleDataDigest(proto_item *ti, tvbuff_t *tvb, guint offset, int dataLen) {
- int available_bytes = tvb_length_remaining(tvb, offset);
+ int available_bytes = tvb_captured_length_remaining(tvb, offset);
if(enableDataDigests) {
if(dataDigestIsCRC32) {
if(available_bytes >= (dataLen + 4)) {
@@ -728,7 +728,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
gboolean S_bit=FALSE;
gboolean A_bit=FALSE;
guint cdb_offset = offset + 32; /* offset of CDB from start of PDU */
- guint end_offset = offset + tvb_length_remaining(tvb, offset);
+ guint end_offset = offset + tvb_captured_length_remaining(tvb, offset);
iscsi_conv_data_t *cdata = NULL;
int paddedDataSegmentLength = data_segment_len;
guint16 lun=0xffff;
@@ -1468,7 +1468,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
tvbuff_t *data_tvb;
int tvb_len, tvb_rlen;
- tvb_len=tvb_length_remaining(tvb, offset);
+ tvb_len=tvb_captured_length_remaining(tvb, offset);
if(tvb_len>snsl)
tvb_len=snsl;
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
@@ -1590,7 +1590,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
int tvb_len, tvb_rlen;
/* SCSI Command */
- tvb_len=tvb_length_remaining(tvb, cdb_offset);
+ tvb_len=tvb_captured_length_remaining(tvb, cdb_offset);
tvb_rlen=tvb_reported_length_remaining(tvb, cdb_offset);
if(ahs_cdb_length && ahs_cdb_length<1024){
guint8 *cdb_buf;
@@ -1625,7 +1625,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
/* where there any ImmediateData ? */
if(immediate_data_length){
/* Immediate Data TVB */
- tvb_len=tvb_length_remaining(tvb, immediate_data_offset);
+ tvb_len=tvb_captured_length_remaining(tvb, immediate_data_offset);
if(tvb_len>(int)immediate_data_length)
tvb_len=immediate_data_length;
tvb_rlen=tvb_reported_length_remaining(tvb, immediate_data_offset);
@@ -1651,7 +1651,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
tvbuff_t *data_tvb;
int tvb_len, tvb_rlen;
- tvb_len=tvb_length_remaining(tvb, offset);
+ tvb_len=tvb_captured_length_remaining(tvb, offset);
if(tvb_len>senseLen)
tvb_len=senseLen;
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
@@ -1674,7 +1674,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
int tvb_len, tvb_rlen;
/* offset is setup correctly by the iscsi code for response above */
- tvb_len=tvb_length_remaining(tvb, offset);
+ tvb_len=tvb_captured_length_remaining(tvb, offset);
if(tvb_len>(int)data_segment_len)
tvb_len=data_segment_len;
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
@@ -1697,7 +1697,7 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec
/* Set up structures needed to add the protocol subtree and manage it */
guint iSCSIPdusDissected = 0;
guint offset = 0;
- guint32 available_bytes = tvb_length(tvb);
+ guint32 available_bytes = tvb_captured_length(tvb);
int digestsActive = 1;
conversation_t *conversation = NULL;
iscsi_session_t *iscsi_session=NULL;
@@ -2458,7 +2458,7 @@ dissect_iscsi_handle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
*/
static gboolean
dissect_iscsi_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- guint32 available_bytes = tvb_length(tvb);
+ guint32 available_bytes = tvb_captured_length(tvb);
/* quick check to see if the packet is long enough to contain the
* minimum amount of information we need */
diff --git a/epan/dissectors/packet-isdn-sup.c b/epan/dissectors/packet-isdn-sup.c
index 81b7d2233e..1140288e78 100644
--- a/epan/dissectors/packet-isdn-sup.c
+++ b/epan/dissectors/packet-isdn-sup.c
@@ -2641,7 +2641,7 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!op_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_operation, tvb, 0, 0, opcode);
@@ -2656,9 +2656,9 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (op_ptr->arg_pdu)
offset = op_ptr->arg_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED ARGUMENT TYPE (ETSI Sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -2690,7 +2690,7 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!op_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_operation, tvb, 0, 0, opcode);
@@ -2705,9 +2705,9 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (op_ptr->res_pdu)
offset = op_ptr->res_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED RESULT TYPE (ETSI sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -2740,7 +2740,7 @@ dissect_isdn_sup_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!err_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_error, tvb, 0, 0, errcode);
@@ -2755,9 +2755,9 @@ dissect_isdn_sup_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (err_ptr->err_pdu)
offset = err_ptr->err_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED ERROR TYPE (ETSI sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-isis-hello.c b/epan/dissectors/packet-isis-hello.c
index e93e6817eb..43464be44d 100644
--- a/epan/dissectors/packet-isis-hello.c
+++ b/epan/dissectors/packet-isis-hello.c
@@ -564,7 +564,7 @@ dissect_hello_checksum_clv(tvbuff_t *tvb, packet_info* pinfo,
break;
case DATA_MISSING :
proto_tree_add_expert_format(tree, pinfo, &ei_isis_hello_long_packet, tvb, offset, -1,
- "Packet length %d went beyond packet", tvb_length(tvb) );
+ "Packet length %d went beyond packet", tvb_captured_length(tvb) );
break;
case CKSUM_NOT_OK :
proto_tree_add_uint_format_value( tree, hf_isis_hello_checksum, tvb, offset, length, checksum,
@@ -1011,7 +1011,7 @@ dissect_isis_l1_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_hello(tvb, pinfo, tree, 0,
clv_l1_hello_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1020,7 +1020,7 @@ dissect_isis_l2_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_hello(tvb, pinfo, tree, 0,
clv_l2_hello_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1029,7 +1029,7 @@ dissect_isis_ptp_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_hello(tvb, pinfo, tree, 0,
clv_ptp_hello_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c
index c16186efae..2af3771ddc 100644
--- a/epan/dissectors/packet-isis-lsp.c
+++ b/epan/dissectors/packet-isis-lsp.c
@@ -2627,7 +2627,7 @@ dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset
case DATA_MISSING :
proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_long_packet, tvb, offset, -1,
"Packet length %d went beyond packet",
- tvb_length_remaining(tvb, offset_checksum));
+ tvb_captured_length_remaining(tvb, offset_checksum));
break;
case CKSUM_NOT_OK :
it_cksum = proto_tree_add_uint_format_value(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum,
@@ -2691,7 +2691,7 @@ dissect_isis_l1_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_lsp(tvb, pinfo, tree, 0,
clv_l1_lsp_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -2700,7 +2700,7 @@ dissect_isis_l2_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_lsp(tvb, pinfo, tree, 0,
clv_l2_lsp_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-isis-snp.c b/epan/dissectors/packet-isis-snp.c
index a71807e759..678db0ee39 100644
--- a/epan/dissectors/packet-isis-snp.c
+++ b/epan/dissectors/packet-isis-snp.c
@@ -131,7 +131,7 @@ dissect_snp_checksum_clv(tvbuff_t *tvb, packet_info* pinfo,
break;
case DATA_MISSING :
expert_add_info_format(pinfo, ti, &ei_isis_csnp_long_packet,
- "Packet length %d went beyond packet", tvb_length(tvb));
+ "Packet length %d went beyond packet", tvb_captured_length(tvb));
break;
case CKSUM_NOT_OK :
proto_item_append_text(ti, " [incorrect, should be 0x%04x]", cacl_checksum);
@@ -353,7 +353,7 @@ dissect_isis_l1_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_csnp(tvb, pinfo, tree, 0,
clv_l1_csnp_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -362,7 +362,7 @@ dissect_isis_l2_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_csnp(tvb, pinfo, tree, 0,
clv_l2_csnp_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -406,7 +406,7 @@ dissect_isis_l1_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_psnp(tvb, pinfo, tree, 0,
clv_l1_psnp_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -415,7 +415,7 @@ dissect_isis_l2_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
isis_data_t* isis = (isis_data_t*)data;
dissect_isis_psnp(tvb, pinfo, tree, 0,
clv_l2_psnp_opts, isis->header_length, isis->system_id_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-isl.c b/epan/dissectors/packet-isl.c
index e580cd4a5a..1d8439d9c1 100644
--- a/epan/dissectors/packet-isl.c
+++ b/epan/dissectors/packet-isl.c
@@ -259,7 +259,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len)
length -= 12;
/* Trim the captured length. */
- captured_length = tvb_length_remaining(payload_tvb, 12);
+ captured_length = tvb_captured_length_remaining(payload_tvb, 12);
/* Make sure it's not bigger than the actual length. */
if (captured_length > length)
diff --git a/epan/dissectors/packet-ismp.c b/epan/dissectors/packet-ismp.c
index 30c79fda03..3f92f13c4a 100644
--- a/epan/dissectors/packet-ismp.c
+++ b/epan/dissectors/packet-ismp.c
@@ -252,7 +252,7 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp
/* create display subtree for EDP */
if (ismp_tree) {
edp_ti = proto_tree_add_item(ismp_tree, hf_ismp_edp, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_NA);
+ tvb_captured_length_remaining(tvb, offset), ENC_NA);
edp_tree = proto_item_add_subtree(edp_ti, ett_ismp_edp);
col_add_fstr(pinfo->cinfo, COL_INFO, "MIP %s, MMAC %s, ifIdx %d",
diff --git a/epan/dissectors/packet-isns.c b/epan/dissectors/packet-isns.c
index d59b8e087b..0ca54a2989 100644
--- a/epan/dissectors/packet-isns.c
+++ b/epan/dissectors/packet-isns.c
@@ -572,7 +572,7 @@ dissect_isns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
"Unknown function ID 0x%04x"));
if (tree == NULL)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
/* create display subtree for the protocol */
ti = proto_tree_add_item(tree, proto_isns, tvb, 0, -1, ENC_NA);
@@ -652,7 +652,7 @@ dissect_isns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
/* Fall Thru if there are attributes */
if (tvb_reported_length_remaining(tvb, offset) == 0)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
/* Messages */
case ISNS_FUNC_DEVATTRREG:
@@ -675,7 +675,7 @@ dissect_isns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
/* we can only look at the attributes for the first PDU */
if(!(flags&ISNS_FLAGS_FIRST_PDU)){
proto_tree_add_text(tt, tvb, offset, -1, "This is not the first PDU. The attributes are not decoded");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
packet_len = tvb_reported_length(tvb);
@@ -685,7 +685,7 @@ dissect_isns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -700,7 +700,7 @@ get_isns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
static int
dissect_isns_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
guint16 isns_protocol_version;
guint16 function_id;
@@ -731,7 +731,7 @@ dissect_isns_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
static int
dissect_isns_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
guint16 isns_protocol_version;
guint16 function_id;
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index ac62d15fc3..4bf0f3a81a 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -3300,7 +3300,7 @@ dissect_isup_called_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *
}
offset += 1;
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid */
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid */
proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
@@ -3367,7 +3367,7 @@ dissect_isup_subsequent_number_parameter(tvbuff_t *parameter_tvb, proto_tree *pa
offset += 1;
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) {
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) {
/* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
@@ -4792,7 +4792,7 @@ dissect_bat_ase_Encapsulated_Application_Information(tvbuff_t *parameter_tvb, pa
sdp_length = (length_indicator) - 3;
- if (sdp_length > tvb_length_remaining(parameter_tvb, offset)) {
+ if (sdp_length > tvb_captured_length_remaining(parameter_tvb, offset)) {
/* If this is a segmented message we may not have all the data */
next_tvb = tvb_new_subset_remaining(parameter_tvb, offset);
} else {
@@ -5025,7 +5025,7 @@ dissect_isup_application_transport_parameter(tvbuff_t *parameter_tvb, packet_inf
pinfo,
(apm_Segmentation_local_ref & 0x7f), /* ID for fragments belonging together */
NULL,
- tvb_length_remaining(parameter_tvb, offset), /* fragment length - to the end */
+ tvb_captured_length_remaining(parameter_tvb, offset), /* fragment length - to the end */
more_frag); /* More fragments? */
if ((si_and_apm_seg_ind & 0x3f) !=0 && (si_and_apm_seg_ind &0x40) !=0) {
@@ -5065,7 +5065,7 @@ dissect_isup_application_transport_parameter(tvbuff_t *parameter_tvb, packet_inf
}
proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1,
- "APM-user information field (%u Bytes)", tvb_length_remaining(parameter_tvb, offset));
+ "APM-user information field (%u Bytes)", tvb_captured_length_remaining(parameter_tvb, offset));
switch (aci16 & 0x7fff) {
case 3:
@@ -5133,7 +5133,7 @@ dissect_isup_calling_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree
proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
offset = 2;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
if (length == 0) {
proto_tree_add_text(parameter_tree, parameter_tvb, offset, 0, "Calling Number (empty)");
proto_item_set_text(parameter_item, "Calling Number: (empty)");
@@ -5160,10 +5160,10 @@ dissect_isup_calling_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) {
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) {
/* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
@@ -5213,7 +5213,7 @@ dissect_isup_original_called_number_parameter(tvbuff_t *parameter_tvb, proto_tre
proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
offset = 2;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
if (length == 0) {
proto_tree_add_text(parameter_tree, parameter_tvb, offset, 0, "Original Called Number (empty)");
@@ -5226,7 +5226,7 @@ dissect_isup_original_called_number_parameter(tvbuff_t *parameter_tvb, proto_tre
"Original Called Number");
address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit,
@@ -5242,10 +5242,10 @@ dissect_isup_original_called_number_parameter(tvbuff_t *parameter_tvb, proto_tre
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) {
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) {
/* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
@@ -5282,7 +5282,7 @@ dissect_isup_redirecting_number_parameter(tvbuff_t *parameter_tvb, proto_tree *p
proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
offset = 2;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
if (length == 0) {
proto_tree_add_text(parameter_tree, parameter_tvb, offset, 0, "Redirecting Number (empty)");
@@ -5295,7 +5295,7 @@ dissect_isup_redirecting_number_parameter(tvbuff_t *parameter_tvb, proto_tree *p
"Redirecting Number");
address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit,
@@ -5311,10 +5311,10 @@ dissect_isup_redirecting_number_parameter(tvbuff_t *parameter_tvb, proto_tree *p
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) {
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) {
/* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
@@ -5356,7 +5356,7 @@ dissect_isup_redirection_number_parameter(tvbuff_t *parameter_tvb, proto_tree *p
"Redirection Number");
address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit,
@@ -5372,10 +5372,10 @@ dissect_isup_redirection_number_parameter(tvbuff_t *parameter_tvb, proto_tree *p
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) {
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) {
/* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
@@ -5420,7 +5420,7 @@ dissect_isup_connection_request_parameter(tvbuff_t *parameter_tvb, proto_tree *p
void
dissect_isup_redirection_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
- if (tvb_length(parameter_tvb) == 2) {
+ if (tvb_captured_length(parameter_tvb) == 2) {
guint16 indicators;
indicators = tvb_get_ntohs(parameter_tvb, 0);
proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb, 0, REDIRECTION_INFO_LENGTH, indicators);
@@ -5464,7 +5464,7 @@ dissect_isup_closed_user_group_interlock_code_parameter(tvbuff_t *parameter_tvb,
*/
static void
dissect_isup_user_service_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
"User service information (-> Q.931 Bearer_capability)");
proto_item_set_text(parameter_item, "User service information, (%u byte%s length)",
@@ -5510,7 +5510,7 @@ dissect_isup_connected_number_parameter(tvbuff_t *parameter_tvb, proto_tree *par
proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
offset = 2;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
if (length == 0)
return; /* empty connected number */
address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
@@ -5533,10 +5533,10 @@ dissect_isup_connected_number_parameter(tvbuff_t *parameter_tvb, proto_tree *par
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) {
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) {
/* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
@@ -5576,7 +5576,7 @@ dissect_isup_transit_network_selection_parameter(tvbuff_t *parameter_tvb, proto_
"Network identification");
address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit,
@@ -5592,10 +5592,10 @@ dissect_isup_transit_network_selection_parameter(tvbuff_t *parameter_tvb, proto_
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid & has be displayed */
+ if (((indicators & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
@@ -5844,7 +5844,7 @@ dissect_isup_access_delivery_information_parameter(tvbuff_t *parameter_tvb, prot
*/
static void
dissect_isup_network_specific_facility_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Network specific facility (refer to 3.36/Q.763 for detailed decoding)");
proto_item_set_text(parameter_item, "Network specific facility (%u byte%s length)", length , plurality(length, "", "s"));
}
@@ -5853,7 +5853,7 @@ dissect_isup_network_specific_facility_parameter(tvbuff_t *parameter_tvb, proto_
*/
static void
dissect_isup_user_service_information_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
"User service information prime (-> Q.931 Bearer capability information IE)");
dissect_q931_bearer_capability_ie(parameter_tvb,
@@ -5880,7 +5880,7 @@ dissect_isup_propagation_delay_counter_parameter(tvbuff_t *parameter_tvb, proto_
*/
static void
dissect_isup_remote_operations_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Remote operations");
proto_item_set_text(parameter_item, "Remote operations (%u byte%s length)", length , plurality(length, "", "s"));
}
@@ -5892,7 +5892,7 @@ dissect_isup_service_activation_parameter(tvbuff_t *parameter_tvb, proto_tree *p
{
guint i;
guint8 feature_code;
- guint length = tvb_length(parameter_tvb);
+ guint length = tvb_captured_length(parameter_tvb);
for (i=0; i<length; i++) {
feature_code = tvb_get_guint8(parameter_tvb, i);
@@ -5906,7 +5906,7 @@ dissect_isup_service_activation_parameter(tvbuff_t *parameter_tvb, proto_tree *p
static void
dissect_isup_user_teleservice_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
- guint length = tvb_length(parameter_tvb);
+ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
"User teleservice information (-> Q.931 High Layer Compatibility IE)");
@@ -6015,7 +6015,7 @@ static const true_false_string isup_pass_on_not_possible_indicator_value = {
static void
dissect_isup_message_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
- guint length = tvb_length(parameter_tvb);
+ guint length = tvb_captured_length(parameter_tvb);
guint instruction_indicators;
gint offset = 0;
@@ -6085,7 +6085,7 @@ static const value_string ISUP_Broadband_narrowband_interworking_indicator_vals[
static void
dissect_isup_parameter_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
- guint length = tvb_length(parameter_tvb);
+ guint length = tvb_captured_length(parameter_tvb);
guint len = length;
guint8 upgraded_parameter, upgraded_parameter_no;
guint8 offset;
@@ -6306,7 +6306,7 @@ dissect_isup_location_number_parameter(tvbuff_t *parameter_tvb, proto_tree *para
* (network provided).
* BUG 938 - Just check if there is someting more to dissect.
*/
- if (tvb_length_remaining(parameter_tvb, offset) < 3) {
+ if (tvb_captured_length_remaining(parameter_tvb, offset) < 3) {
proto_tree_add_text(parameter_tree, parameter_tvb, 1, -1, "Location number: address not available");
proto_item_set_text(parameter_item, "Location number: address not available");
return;
@@ -6319,7 +6319,7 @@ dissect_isup_location_number_parameter(tvbuff_t *parameter_tvb, proto_tree *para
"Location number");
address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit,
@@ -6335,10 +6335,10 @@ dissect_isup_location_number_parameter(tvbuff_t *parameter_tvb, proto_tree *para
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) {
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) {
/* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
@@ -6440,7 +6440,7 @@ dissect_isup_call_transfer_number_parameter(tvbuff_t *parameter_tvb, proto_tree
"Call transfer number");
address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit,
@@ -6456,10 +6456,10 @@ dissect_isup_call_transfer_number_parameter(tvbuff_t *parameter_tvb, proto_tree
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid & has be displayed */
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
if (i > MAXDIGITS)
@@ -6494,7 +6494,7 @@ dissect_isup_ccss_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree,
*/
static void
dissect_isup_forward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Forward GVNS (refer to 3.66/Q.763 for detailed decoding)");
proto_item_set_text(parameter_item, "Forward GVNS (%u Byte%s)", length , plurality(length, "", "s"));
}
@@ -6517,7 +6517,7 @@ static const value_string isup_jpn_redirect_capabilit_vals[] = {
static void
dissect_isup_redirect_capability_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item, guint8 itu_isup_variant)
{
- guint length = tvb_length(parameter_tvb);
+ guint length = tvb_captured_length(parameter_tvb);
switch (itu_isup_variant) {
case ISUP_JAPAN_VARIANT:
@@ -6564,7 +6564,7 @@ dissect_isup_network_management_controls_parameter(tvbuff_t *parameter_tvb, prot
*/
static void
dissect_isup_correlation_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Correlation ID (-> Q.1281)");
proto_item_set_text(parameter_item, "Correlation ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
}
@@ -6573,7 +6573,7 @@ dissect_isup_correlation_id_parameter(tvbuff_t *parameter_tvb, proto_tree *param
*/
static void
dissect_isup_scf_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "SCF ID (-> Q.1281)");
proto_item_set_text(parameter_item, "SCF ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
}
@@ -6617,7 +6617,7 @@ dissect_isup_called_in_number_parameter(tvbuff_t *parameter_tvb, proto_tree *par
"Called IN Number");
address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit,
@@ -6633,10 +6633,10 @@ dissect_isup_called_in_number_parameter(tvbuff_t *parameter_tvb, proto_tree *par
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid & has be displayed */
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
if (i > MAXDIGITS)
@@ -6665,7 +6665,7 @@ dissect_isup_call_offering_treatment_indicators_parameter(tvbuff_t *parameter_tv
*/
static void
dissect_isup_charged_party_identification_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
"Charged party identification (format is national network specific)");
proto_item_set_text(parameter_item, "Charged party identification (%u Byte%s)", length , plurality(length, "", "s"));
@@ -6700,7 +6700,7 @@ dissect_isup_conference_treatment_indicators_parameter(tvbuff_t *parameter_tvb,
*/
static void
dissect_isup_display_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
"Display information (-> Q.931)");
proto_item_set_text(parameter_item, "Display information (%u Byte%s)",
@@ -6736,7 +6736,7 @@ dissect_isup_uid_capability_indicators_parameter(tvbuff_t *parameter_tvb, proto_
static void
dissect_isup_redirect_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item, guint8 itu_isup_variant)
{
- guint length = tvb_length(parameter_tvb);
+ guint length = tvb_captured_length(parameter_tvb);
switch (itu_isup_variant) {
case ISUP_JAPAN_VARIANT:
@@ -6774,7 +6774,7 @@ dissect_isup_collect_call_request_parameter(tvbuff_t *parameter_tvb, proto_tree
static void
dissect_isup_calling_geodetic_location_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
{
- guint length = tvb_length(parameter_tvb);
+ guint length = tvb_captured_length(parameter_tvb);
guint8 oct, lpri;
oct = tvb_get_guint8(parameter_tvb, 0);
@@ -6839,7 +6839,7 @@ dissect_isup_generic_number_parameter(tvbuff_t *parameter_tvb, proto_tree *param
proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 2, 1, indicators2);
offset = 3;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
if (length == 0) {
proto_tree_add_text(parameter_tree, parameter_tvb, offset, 0, "Generic Number (empty)");
proto_item_set_text(parameter_item, "Generic Number: (empty)");
@@ -6865,10 +6865,10 @@ dissect_isup_generic_number_parameter(tvbuff_t *parameter_tvb, proto_tree *param
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) {
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) {
/* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
@@ -6929,7 +6929,7 @@ dissect_isup_jurisdiction_parameter(tvbuff_t *parameter_tvb, proto_tree *paramet
offset += 1;
}
- if (tvb_length(parameter_tvb) > 0) {
+ if (tvb_captured_length(parameter_tvb) > 0) {
proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
@@ -6953,7 +6953,7 @@ dissect_isup_generic_name_parameter(tvbuff_t *parameter_tvb, proto_tree *paramet
gen_name = (char *)wmem_alloc(wmem_packet_scope(), MAXGNAME + 1);
gen_name[0] = '\0';
- gen_name_length = tvb_length(parameter_tvb) - 1;
+ gen_name_length = tvb_captured_length(parameter_tvb) - 1;
indicator = tvb_get_guint8(parameter_tvb, 0);
proto_tree_add_uint(parameter_tree, hf_isup_generic_name_presentation, parameter_tvb, 1, 1, indicator);
proto_tree_add_boolean(parameter_tree, hf_isup_generic_name_availability, parameter_tvb, 1, 1, indicator);
@@ -6970,7 +6970,7 @@ dissect_isup_generic_name_parameter(tvbuff_t *parameter_tvb, proto_tree *paramet
*/
static void
dissect_isup_generic_digits_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Generic digits (refer to 3.24/Q.673 for detailed decoding)");
proto_item_set_text(parameter_item, "Generic digits (%u Byte%s)", length , plurality(length, "", "s"));
}
@@ -7002,7 +7002,7 @@ dissect_isup_charge_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parame
"Charge Number");
address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit,
@@ -7018,10 +7018,10 @@ dissect_isup_charge_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parame
THROW(ReportedBoundsError);
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
- if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid & has be displayed */
+ if (((indicators1 & 0x80) == 0) && (tvb_captured_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid & has be displayed */
proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit,
parameter_tvb, offset - 1, 1, address_digit_pair);
calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
@@ -7037,7 +7037,7 @@ dissect_isup_charge_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parame
/* ------------------------------------------------------------------ */
static void
dissect_isup_unknown_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_item)
-{ guint length = tvb_length(parameter_tvb);
+{ guint length = tvb_captured_length(parameter_tvb);
proto_item_set_text(parameter_item, "Parameter Type unknown/reserved (%u Byte%s)", length , plurality(length, "", "s"));
}
/* ------------------------------------------------------------------ */
@@ -7058,7 +7058,7 @@ dissect_japan_isup_called_dir_num(tvbuff_t *parameter_tvb, proto_tree *parameter
int offset = 0;
int parameter_length;
- parameter_length = tvb_length_remaining(parameter_tvb, offset);
+ parameter_length = tvb_captured_length_remaining(parameter_tvb, offset);
proto_tree_add_item(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -7225,7 +7225,7 @@ dissect_japan_isup_redirect_fwd_inf(tvbuff_t *parameter_tvb, proto_tree *paramet
guint8 tag, tag_len, ext_ind;
int parameter_length;
- parameter_length = tvb_length_remaining(parameter_tvb, offset);
+ parameter_length = tvb_captured_length_remaining(parameter_tvb, offset);
while (offset < parameter_length) {
/* Information Type Tag */
@@ -7288,7 +7288,7 @@ dissect_japan_isup_redirect_backw_inf(tvbuff_t *parameter_tvb, proto_tree *param
guint8 tag, tag_len, ext_ind;
int parameter_length;
- parameter_length = tvb_length_remaining(parameter_tvb, offset);
+ parameter_length = tvb_captured_length_remaining(parameter_tvb, offset);
while (offset < parameter_length) {
/* Information Type Tag */
@@ -7483,7 +7483,7 @@ dissect_japan_isup_additonal_user_cat(tvbuff_t *parameter_tvb, proto_tree *param
guint8 type;
int parameter_length;
- parameter_length = tvb_length_remaining(parameter_tvb, offset);
+ parameter_length = tvb_captured_length_remaining(parameter_tvb, offset);
while (offset < parameter_length) {
/* Type of Additional User/Service Information */
@@ -7548,7 +7548,7 @@ dissect_japan_isup_contractor_number(tvbuff_t *parameter_tvb, proto_tree *parame
int parameter_length;
const char *digit_str;
- parameter_length = tvb_length_remaining(parameter_tvb, offset);
+ parameter_length = tvb_captured_length_remaining(parameter_tvb, offset);
proto_tree_add_item(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -7622,7 +7622,7 @@ dissect_japan_isup_carrier_information(tvbuff_t *parameter_tvb, proto_tree *para
proto_tree_add_uint(parameter_tree, hf_isup_carrier_info_iec, parameter_tvb, 0, 1, octet);
- length = tvb_length_remaining(parameter_tvb, 2);
+ length = tvb_captured_length_remaining(parameter_tvb, 2);
if (length == 0) {
proto_tree_add_text(parameter_tree, parameter_tvb, offset, 0, "Carrier Information (empty)");
proto_item_set_text(parameter_item, "Carrier Information (empty)");
@@ -7797,7 +7797,7 @@ dissect_japan_isup_carrier_information(tvbuff_t *parameter_tvb, proto_tree *para
}
offset += 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
}
/* Write to top of tree */
@@ -7822,7 +7822,7 @@ dissect_japan_isup_charge_inf_delay(tvbuff_t *parameter_tvb, proto_tree *paramet
int offset = 0;
int parameter_length;
- parameter_length = tvb_length_remaining(parameter_tvb, offset);
+ parameter_length = tvb_captured_length_remaining(parameter_tvb, offset);
while (offset < parameter_length) {
proto_tree_add_item(parameter_tree, hf_japan_isup_charge_delay_type, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -7908,7 +7908,7 @@ dissect_japan_isup_charge_area_info(tvbuff_t *parameter_tvb, proto_tree *paramet
proto_tree_add_uint(parameter_tree, hf_japan_isup_charge_area_nat_of_info_value, parameter_tvb, 0, 1, octet);
offset = 1;
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
/*Only CA code digits.*/
if (nat_of_info_indic == CHARGE_AREA_NAT_INFO_CA) {
@@ -7952,7 +7952,7 @@ dissect_japan_isup_charge_area_info(tvbuff_t *parameter_tvb, proto_tree *paramet
octet++;
/* Now loop through MA/CA digits.*/
- length = tvb_length_remaining(parameter_tvb, offset);
+ length = tvb_captured_length_remaining(parameter_tvb, offset);
while (length > 0) {
octet = tvb_get_guint8(parameter_tvb, offset);
@@ -8096,7 +8096,7 @@ dissect_japan_chg_inf_type_crt(tvbuff_t *parameter_tvb, proto_tree *parameter_tr
guint8 len;
int parameter_length;
- parameter_length = tvb_length_remaining(parameter_tvb, offset);
+ parameter_length = tvb_captured_length_remaining(parameter_tvb, offset);
/* Unit per Time Period (UTP) */
@@ -8211,7 +8211,7 @@ dissect_isup_optional_parameter(tvbuff_t *optional_parameters_tvb, packet_info *
/* Dissect all optional parameters while end of message isn't reached */
parameter_type = 0xFF; /* Start-initializiation since parameter_type is used for while-condition */
- while ((tvb_length_remaining(optional_parameters_tvb, offset) >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)) {
+ while ((tvb_captured_length_remaining(optional_parameters_tvb, offset) >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)) {
parameter_type = tvb_get_guint8(optional_parameters_tvb, offset);
if (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS) {
@@ -8253,7 +8253,7 @@ dissect_isup_optional_parameter(tvbuff_t *optional_parameters_tvb, packet_info *
if (octet == 0)
continue;
- actual_length = tvb_length_remaining(optional_parameters_tvb, offset);
+ actual_length = tvb_captured_length_remaining(optional_parameters_tvb, offset);
if (actual_length > 0) {
parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
switch (parameter_type) {
@@ -8586,7 +8586,7 @@ dissect_ansi_isup_optional_parameter(tvbuff_t *optional_parameters_tvb, packet_i
/* Dissect all optional parameters while end of message isn't reached */
parameter_type = 0xFF; /* Start-initializiation since parameter_type is used for while-condition */
- while ((tvb_length_remaining(optional_parameters_tvb, offset) >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)) {
+ while ((tvb_captured_length_remaining(optional_parameters_tvb, offset) >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)) {
parameter_type = tvb_get_guint8(optional_parameters_tvb, offset);
if (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS) {
@@ -8612,7 +8612,7 @@ dissect_ansi_isup_optional_parameter(tvbuff_t *optional_parameters_tvb, packet_i
if (octet == 0)
continue;
- actual_length = tvb_length_remaining(optional_parameters_tvb, offset);
+ actual_length = tvb_captured_length_remaining(optional_parameters_tvb, offset);
if (actual_length > 0) {
parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
switch (parameter_type) {
@@ -10137,7 +10137,7 @@ dissect_ansi_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree
break;
case MESSAGE_TYPE_CHARGE_INFO:
/* do nothing since format is a national matter */
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
break;
@@ -10183,7 +10183,7 @@ dissect_ansi_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree
break;
case MESSAGE_TYPE_SUBSEQUENT_DIR_NUM:
/* do nothing since format is a national matter */
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
break;
@@ -10201,7 +10201,7 @@ dissect_ansi_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree
/* no dissector necessary since no mandatory parameters included */
break;
default:
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength,
"Unknown Message type (possibly reserved/used in former ISUP version)");
@@ -10440,7 +10440,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
break;
case MESSAGE_TYPE_CHARGE_INFO:
/* do nothing since format is a national matter */
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0) {
switch (itu_isup_variant) {
case ISUP_RUSSIAN_VARIANT:
@@ -10494,7 +10494,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
break;
case MESSAGE_TYPE_SUBSEQUENT_DIR_NUM:
/* do nothing since format is a national matter */
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
break;
@@ -10502,7 +10502,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
/* Handle national extensions here */
switch (itu_isup_variant) {
case ISUP_ITU_STANDARD_VARIANT:
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength,
"Unknown Message type (possibly reserved/used in former ISUP version)");
@@ -10517,7 +10517,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
opt_part_possible = TRUE;
break;
default:
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength,
"Unknown Message type (possibly reserved/used in former ISUP version)");
@@ -10536,7 +10536,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
/* No parameters */
break;
default:
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength,
"Unknown Message type (possibly reserved/used in former ISUP version)");
@@ -10553,7 +10553,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
opt_part_possible = TRUE;
break;
default:
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength,
"Unknown Message type (possibly reserved/used in former ISUP version)");
@@ -10569,7 +10569,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
opt_part_possible = TRUE;
break;
default:
- bufferlength = tvb_length_remaining(message_tvb, offset);
+ bufferlength = tvb_captured_length_remaining(message_tvb, offset);
if (bufferlength != 0)
proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength,
"Unknown Message type (possibly reserved/used in former ISUP version)");
@@ -10809,7 +10809,7 @@ dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
message_tvb = tvb_new_subset_remaining(tvb, 0);
dissect_ansi_isup_message(message_tvb, pinfo, isup_tree, ISUP_ITU_STANDARD_VARIANT);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} else if (strstr(content_type_parameter_str, "spirou")) {
isup_standard = ITU_STANDARD;
itu_isup_variant = ISUP_FRENCH_VARIANT;
@@ -10871,7 +10871,7 @@ dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
message_tvb = tvb_new_subset_remaining(tvb, 0);
dissect_isup_message(message_tvb, pinfo, isup_tree, itu_isup_variant);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* ---------------------------------------------------- stats tree
*/
diff --git a/epan/dissectors/packet-itdm.c b/epan/dissectors/packet-itdm.c
index 679adbc2e7..022f9039f7 100644
--- a/epan/dissectors/packet-itdm.c
+++ b/epan/dissectors/packet-itdm.c
@@ -364,7 +364,7 @@ dissect_itdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* ZZZ for now, 125 usec mode and I-TDM control protocol
* need to add 1ms mode */
- if (tvb_length(tvb) < 18)
+ if (tvb_captured_length(tvb) < 18)
return;
/* See if this packet is a data flow or the I-TDM control flow. */
diff --git a/epan/dissectors/packet-iua.c b/epan/dissectors/packet-iua.c
index ad9f8b3d51..47e668f9ce 100644
--- a/epan/dissectors/packet-iua.c
+++ b/epan/dissectors/packet-iua.c
@@ -574,10 +574,10 @@ 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(iua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb),
+ parameter_item = proto_tree_add_text(iua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb),
"%s parameter", val_to_str_const(tag, support_IG?parameter_tag_ig_values:parameter_tag_values, "Unknown"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_iua_parameter);
@@ -653,7 +653,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-iuup.c b/epan/dissectors/packet-iuup.c
index 968397cf58..3b4939b8aa 100644
--- a/epan/dissectors/packet-iuup.c
+++ b/epan/dissectors/packet-iuup.c
@@ -355,7 +355,7 @@ iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, in
static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint rfci_id _U_, int offset) {
iuup_circuit_t* iuup_circuit;
iuup_rfci_t *rfci;
- int last_offset = tvb_length(tvb) - 1;
+ int last_offset = tvb_captured_length(tvb) - 1;
guint bit_offset = 0;
proto_item* pi;
@@ -579,7 +579,7 @@ static void add_hdr_crc(tvbuff_t* tvb, packet_info* pinfo, proto_item* iuup_tree
static void add_payload_crc(tvbuff_t* tvb, packet_info* pinfo, proto_item* iuup_tree)
{
proto_item *crc_item;
- int length = tvb_length(tvb);
+ int length = tvb_captured_length(tvb);
guint16 crc10 = tvb_get_ntohs(tvb, 2) & 0x3FF;
guint16 crccheck = update_crc10_by_bytes(crc10, tvb_get_ptr(tvb, 4, length - 4), length - 4);
@@ -612,7 +612,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IuUP");
if (two_byte_pseudoheader) {
- int len = tvb_length(tvb_in) - 2;
+ int len = tvb_captured_length(tvb_in) - 2;
phdr = tvb_get_ntohs(tvb,0);
@@ -780,7 +780,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
static gboolean dissect_iuup_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
- int len = tvb_length(tvb);
+ int len = tvb_captured_length(tvb);
guint8 first_octet = tvb_get_guint8(tvb,0);
guint8 second_octet = tvb_get_guint8(tvb,1);
@@ -812,7 +812,7 @@ static gboolean dissect_iuup_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree
static void find_iuup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
- int len = tvb_length(tvb);
+ int len = tvb_captured_length(tvb);
int offset = 0;
while (len > 3) {
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c
index f7364c84c7..a3c9031b12 100644
--- a/epan/dissectors/packet-iwarp-mpa.c
+++ b/epan/dissectors/packet-iwarp-mpa.c
@@ -308,7 +308,7 @@ remove_markers(tvbuff_t *tvb, packet_info *pinfo, guint32 marker_offset,
DISSECTOR_ASSERT(num_markers > 0);
DISSECTOR_ASSERT(orig_length > MPA_MARKER_LEN * num_markers);
- DISSECTOR_ASSERT(tvb_length(tvb) == orig_length);
+ DISSECTOR_ASSERT(tvb_captured_length(tvb) == orig_length);
/* allocate memory for the marker-free buffer */
mfree_buff_length = orig_length - (MPA_MARKER_LEN * num_markers);
@@ -795,7 +795,7 @@ dissect_iwarp_mpa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
tcpinfo = (struct tcpinfo *)data;
/* FPDU */
- if (tvb_length(tvb) >= MPA_SMALLEST_FPDU_LEN && is_mpa_fpdu(pinfo)) {
+ if (tvb_captured_length(tvb) >= MPA_SMALLEST_FPDU_LEN && is_mpa_fpdu(pinfo)) {
conversation = find_conversation(pinfo->fd->num, &pinfo->src,
&pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
@@ -852,7 +852,7 @@ dissect_iwarp_mpa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
}
/* MPA REQUEST or MPA REPLY */
- if (tvb_length(tvb) >= MPA_REQ_REP_FRAME_HEADER_LEN) {
+ if (tvb_captured_length(tvb) >= MPA_REQ_REP_FRAME_HEADER_LEN) {
if (is_mpa_req(tvb, pinfo))
return dissect_mpa_req_rep(tvb, pinfo, tree, MPA_REQUEST_FRAME);
else if (is_mpa_rep(tvb, pinfo))
diff --git a/epan/dissectors/packet-ixiatrailer.c b/epan/dissectors/packet-ixiatrailer.c
index ad4f39b391..5e83e34535 100644
--- a/epan/dissectors/packet-ixiatrailer.c
+++ b/epan/dissectors/packet-ixiatrailer.c
@@ -84,7 +84,7 @@ dissect_ixiatrailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, voi
guint8 source;
/* Need at least 5 bytes. TODO: should be 15? */
- tvblen = tvb_length(tvb);
+ tvblen = tvb_captured_length(tvb);
if (tvblen < 5) {
return 0;
}
diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c
index 8ff1fe4915..59ad051bd2 100644
--- a/epan/dissectors/packet-ixveriwave.c
+++ b/epan/dissectors/packet-ixveriwave.c
@@ -962,10 +962,10 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
* take that into account by using the FCS length recorded in pinfo. */
/* Watch out for [erroneously] short frames */
- if (tvb_length(next_tvb) > (unsigned int) pinfo->pseudo_header->ieee_802_11.fcs_len) {
+ if (tvb_captured_length(next_tvb) > (unsigned int) pinfo->pseudo_header->ieee_802_11.fcs_len) {
guint32 sent_fcs = 0;
calc_fcs = crc32_802_tvb(next_tvb,
- tvb_length(next_tvb) - pinfo->pseudo_header->ieee_802_11.fcs_len);
+ tvb_captured_length(next_tvb) - pinfo->pseudo_header->ieee_802_11.fcs_len);
/* By virtue of hdr_fcs_ti being set, we know that 'tree' is set,
* so there's no need to check it here. */
diff --git a/epan/dissectors/packet-j1939.c b/epan/dissectors/packet-j1939.c
index d5375b83bb..3001a16973 100644
--- a/epan/dissectors/packet-j1939.c
+++ b/epan/dissectors/packet-j1939.c
@@ -255,7 +255,7 @@ static int dissect_j1939(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
proto_tree_add_item(msg_tree, hf_j1939_data, tvb, 0, -1, ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_register_j1939(void)
diff --git a/epan/dissectors/packet-json.c b/epan/dissectors/packet-json.c
index 71ae0ba28c..889951cada 100644
--- a/epan/dissectors/packet-json.c
+++ b/epan/dissectors/packet-json.c
@@ -163,11 +163,11 @@ dissect_json(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
proto_item_set_len(ti, offset);
/* if we have some unparsed data, pass to data-text-lines dissector (?) */
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
int datalen, reported_datalen;
tvbuff_t *next_tvb;
- datalen = tvb_length_remaining(tvb, offset);
+ datalen = tvb_captured_length_remaining(tvb, offset);
reported_datalen = tvb_reported_length_remaining(tvb, offset);
next_tvb = tvb_new_subset(tvb, offset, datalen, reported_datalen);
@@ -177,7 +177,7 @@ dissect_json(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(%s)", data_name);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void before_object(void *tvbparse_data, const void *wanted_data _U_, tvbparse_elem_t *tok) {
diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c
index 09a2cfc23a..b4914ccf5c 100644
--- a/epan/dissectors/packet-jxta.c
+++ b/epan/dissectors/packet-jxta.c
@@ -2019,7 +2019,7 @@ static int dissect_media( const gchar* fullmediatype, tvbuff_t * tvb, packet_inf
dissected = call_dissector(ssl_handle, tvb, pinfo, tree);
}
} else if (0 == strcmp("application/gzip", mediatype)) {
- tvbuff_t *uncomp_tvb = tvb_child_uncompress(tvb, tvb, 0, tvb_length(tvb));
+ tvbuff_t *uncomp_tvb = tvb_child_uncompress(tvb, tvb, 0, tvb_captured_length(tvb));
if( NULL != uncomp_tvb ) {
add_new_data_source(pinfo, uncomp_tvb, "Uncompressed Element Content");
@@ -2029,14 +2029,14 @@ static int dissect_media( const gchar* fullmediatype, tvbuff_t * tvb, packet_inf
if( dissected > 0 ) {
/* report back the uncompressed length. */
- dissected = tvb_length(tvb);
+ dissected = tvb_captured_length(tvb);
}
}
} else {
- dissected = dissector_try_string(media_type_dissector_table, mediatype, tvb, pinfo, tree, NULL) ? tvb_length(tvb) : 0;
+ dissected = dissector_try_string(media_type_dissector_table, mediatype, tvb, pinfo, tree, NULL) ? tvb_captured_length(tvb) : 0;
- if( dissected != (int) tvb_length(tvb) ) {
- /* g_message( "%s : %d expected, %d dissected", mediatype, tvb_length(tvb), dissected ); */
+ if( dissected != (int) tvb_captured_length(tvb) ) {
+ /* g_message( "%s : %d expected, %d dissected", mediatype, tvb_captured_length(tvb), dissected ); */
}
}
diff --git a/epan/dissectors/packet-kafka.c b/epan/dissectors/packet-kafka.c
index 1ae8649a49..aeeea859b1 100644
--- a/epan/dissectors/packet-kafka.c
+++ b/epan/dissectors/packet-kafka.c
@@ -271,16 +271,16 @@ dissect_kafka_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int s
offset += 4;
if (raw) {
- payload = tvb_child_uncompress(tvb, raw, 0, tvb_length(raw));
+ payload = tvb_child_uncompress(tvb, raw, 0, tvb_captured_length(raw));
if (payload) {
add_new_data_source(pinfo, payload, "Uncompressed Message");
dissect_kafka_message_set(payload, pinfo, subtree, 0);
} else {
/* TODO make this an expert item */
- proto_tree_add_text(subtree, tvb, 0, tvb_length(raw), "[Failed to decompress message!]");
+ proto_tree_add_text(subtree, tvb, 0, tvb_captured_length(raw), "[Failed to decompress message!]");
proto_tree_add_item(subtree, hf_kafka_message_value, raw, 0, -1, ENC_NA);
}
- offset += tvb_length(raw);
+ offset += tvb_captured_length(raw);
}
else {
proto_tree_add_bytes(subtree, hf_kafka_message_value, tvb, offset, 0, NULL);
@@ -864,7 +864,7 @@ dissect_kafka(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
if (wmem_queue_count(match_queue) == 0) {
col_set_str(pinfo->cinfo, COL_INFO, "Kafka Response (Unknown API, Missing Request)");
/* TODO: expert info, don't have request, can't dissect */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
matcher = (kafka_query_response_t *) wmem_queue_pop(match_queue);
@@ -904,7 +904,7 @@ dissect_kafka(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -914,7 +914,7 @@ dissect_kafka_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4,
get_kafka_pdu_len, dissect_kafka, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-kdsp.c b/epan/dissectors/packet-kdsp.c
index c8fc6605ef..c9a908f937 100644
--- a/epan/dissectors/packet-kdsp.c
+++ b/epan/dissectors/packet-kdsp.c
@@ -538,7 +538,7 @@ dissect_kdsp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
expert_add_info(pinfo, command_item, &ei_kdsp_cmdnum);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -546,7 +546,7 @@ dissect_kdsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, FRAME_HEADER_LEN,
get_kdsp_message_len, dissect_kdsp_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c
index 1aa4e6fad1..0a6cc36088 100644
--- a/epan/dissectors/packet-kerberos.c
+++ b/epan/dissectors/packet-kerberos.c
@@ -622,7 +622,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
enc_key_t *ek;
krb5_data data = {0,0,NULL};
krb5_keytab_entry key;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
/* don't do anything if we are not attempting to decrypt data */
@@ -631,7 +631,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -760,7 +760,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
krb5_error_code ret;
krb5_data data;
enc_key_t *ek;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
/* don't do anything if we are not attempting to decrypt data */
@@ -769,7 +769,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -944,7 +944,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
GSList *ske;
service_key_t *sk;
struct des3_ctx ctx;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
@@ -954,7 +954,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -1582,7 +1582,7 @@ dissect_krb5_decrypt_ticket_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offse
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1613,7 +1613,7 @@ dissect_krb5_decrypt_authenticator_data (gboolean imp_tag _U_, tvbuff_t *tvb, in
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1650,7 +1650,7 @@ dissect_krb5_decrypt_KDC_REP_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offs
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1692,7 +1692,7 @@ dissect_krb5_decrypt_PA_ENC_TIMESTAMP (gboolean imp_tag _U_, tvbuff_t *tvb, int
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1724,7 +1724,7 @@ dissect_krb5_decrypt_AP_REP_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offse
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1755,7 +1755,7 @@ dissect_krb5_decrypt_PRIV_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offset,
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* RFC4120 :
* EncKrbPrivPart encrypted with usage
@@ -1786,7 +1786,7 @@ dissect_krb5_decrypt_CRED_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offset,
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* RFC4120 :
* EncKrbCredPart encrypted with usage
@@ -1839,14 +1839,14 @@ dissect_krb5_rfc1964_checksum(asn1_ctx_t *actx _U_, proto_tree *tree, tvbuff_t *
/* the next fields are optional so we have to check that we have
* more data in our buffers */
- if(tvb_length_remaining(tvb, offset)<2){
+ if(tvb_captured_length_remaining(tvb, offset)<2){
return offset;
}
/* dlgopt identifier */
proto_tree_add_item(tree, hf_krb_gssapi_dlgopt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- if(tvb_length_remaining(tvb, offset)<2){
+ if(tvb_captured_length_remaining(tvb, offset)<2){
return offset;
}
/* dlglen identifier */
@@ -1854,8 +1854,8 @@ dissect_krb5_rfc1964_checksum(asn1_ctx_t *actx _U_, proto_tree *tree, tvbuff_t *
proto_tree_add_item(tree, hf_krb_gssapi_dlglen, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- if(dlglen!=tvb_length_remaining(tvb, offset)){
- proto_tree_add_text(tree, tvb, 0, 0, "Error: DlgLen:%d is not the same as number of bytes remaining:%d", dlglen, tvb_length_remaining(tvb, offset));
+ if(dlglen!=tvb_captured_length_remaining(tvb, offset)){
+ proto_tree_add_text(tree, tvb, 0, 0, "Error: DlgLen:%d is not the same as number of bytes remaining:%d", dlglen, tvb_captured_length_remaining(tvb, offset));
return offset;
}
@@ -2237,7 +2237,7 @@ dissect_kerberos_T_keyvalue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
#line 309 "../../asn1/kerberos/kerberos.cnf"
kerberos_private_data_t *private_data = kerberos_get_private_data(actx);
- private_data->key.keylength = tvb_length_remaining(tvb, offset);
+ private_data->key.keylength = tvb_captured_length_remaining(tvb, offset);
private_data->key.keyvalue = tvb_get_ptr(tvb, offset, private_data->key.keylength);
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
@@ -4088,7 +4088,7 @@ dissect_kerberos_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
All krb5 commands start with an APPL tag and thus is >=0x60
so if first byte is <=16 just blindly assume it is krb4 then
*/
- if(tvb_length(tvb) >= 1 && tvb_get_guint8(tvb, 0)<=0x10){
+ if(tvb_captured_length(tvb) >= 1 && tvb_get_guint8(tvb, 0)<=0x10){
if(krb4_handle){
gboolean res;
@@ -4139,7 +4139,7 @@ dissect_kerberos_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
col_set_str(pinfo->cinfo, COL_INFO, "Continuation");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -4150,7 +4150,7 @@ dissect_kerberos_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
tcp_dissect_pdus(tvb, pinfo, tree, krb_desegment, 4, get_krb_pdu_len,
dissect_kerberos_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_kerberos -------------------------------------------*/
@@ -4985,7 +4985,7 @@ static int wrap_dissect_gss_kerb(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_kerberos_main(auth_tvb, pinfo, tree, FALSE, NULL);
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
diff --git a/epan/dissectors/packet-kingfisher.c b/epan/dissectors/packet-kingfisher.c
index 2235bf9cd3..06679d8a5b 100644
--- a/epan/dissectors/packet-kingfisher.c
+++ b/epan/dissectors/packet-kingfisher.c
@@ -232,7 +232,7 @@ dissect_kingfisher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
/* verify the length */
kfp.length = tvb_get_guint8(tvb, 2);
- if((kfp.length+1) != (guint8)tvb_length(tvb)){
+ if((kfp.length+1) != (guint8)tvb_captured_length(tvb)){
return FALSE;
}
diff --git a/epan/dissectors/packet-kink.c b/epan/dissectors/packet-kink.c
index ab1e49803a..96267bae92 100644
--- a/epan/dissectors/packet-kink.c
+++ b/epan/dissectors/packet-kink.c
@@ -364,7 +364,7 @@ dissect_payload_kink_ap_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
tvbuff_t *krb_tvb;
krb_ap_req_length = payload_length - PAYLOAD_HEADER;
- krb_tvb=tvb_new_subset(tvb, offset, (krb_ap_req_length>tvb_length_remaining(tvb, offset))?tvb_length_remaining(tvb, offset):krb_ap_req_length, krb_ap_req_length);
+ krb_tvb=tvb_new_subset(tvb, offset, (krb_ap_req_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_ap_req_length, krb_ap_req_length);
keytype=kerberos_output_keytype();
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_ap_req_tree, FALSE, NULL);
/*offset += krb_ap_req_length;*/
@@ -419,7 +419,7 @@ dissect_payload_kink_ap_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
tvbuff_t *krb_tvb;
krb_ap_rep_length = payload_length - PAYLOAD_HEADER;
- krb_tvb=tvb_new_subset(tvb, offset, (krb_ap_rep_length>tvb_length_remaining(tvb, offset))?tvb_length_remaining(tvb, offset):krb_ap_rep_length, krb_ap_rep_length);
+ krb_tvb=tvb_new_subset(tvb, offset, (krb_ap_rep_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_ap_rep_length, krb_ap_rep_length);
keytype=kerberos_output_keytype();
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_ap_rep_tree, FALSE, NULL);
@@ -472,7 +472,7 @@ dissect_payload_kink_krb_error(packet_info *pinfo, tvbuff_t *tvb, int offset, pr
tvbuff_t *krb_tvb;
krb_error_length = payload_length - KINK_KRB_ERROR_HEADER;
- krb_tvb=tvb_new_subset(tvb, offset, (krb_error_length>tvb_length_remaining(tvb, offset))?tvb_length_remaining(tvb, offset):krb_error_length, krb_error_length);
+ krb_tvb=tvb_new_subset(tvb, offset, (krb_error_length>tvb_captured_length_remaining(tvb, offset))?tvb_captured_length_remaining(tvb, offset):krb_error_length, krb_error_length);
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_krb_error_tree, FALSE, NULL);
/*offset += krb_error_length;*/
@@ -644,7 +644,7 @@ dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto
if(payload_length > PAYLOAD_HEADER){
isakmp_length = payload_length - PAYLOAD_HEADER;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length > (int)isakmp_length)
length = isakmp_length;
reported_length = tvb_reported_length_remaining(tvb, offset);
@@ -708,7 +708,7 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
tvbuff_t *next_tvb;
guint8 *plaintext=NULL;
- next_tvb=tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset), encrypt_length), encrypt_length);
+ next_tvb=tvb_new_subset(tvb, offset, MIN(tvb_captured_length_remaining(tvb, offset), encrypt_length), encrypt_length);
plaintext=decrypt_krb5_data(tree, pinfo, 0, next_tvb, keytype, NULL);
if(plaintext){
next_tvb=tvb_new_child_real_data(tvb, plaintext, encrypt_length, encrypt_length);
diff --git a/epan/dissectors/packet-knet.c b/epan/dissectors/packet-knet.c
index 1081fd59e1..a697967639 100644
--- a/epan/dissectors/packet-knet.c
+++ b/epan/dissectors/packet-knet.c
@@ -563,7 +563,7 @@ static int
dissect_knet_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_knet(tvb, pinfo, tree, KNET_TCP_PACKET);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -573,7 +573,7 @@ dissect_knet_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
col_set_str(pinfo->cinfo, COL_PROTOCOL, "KNET");
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 2, get_knet_pdu_len, dissect_knet_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/**
@@ -645,7 +645,7 @@ dissect_knet_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(tvb_get_guint8(tvb, 0) & UDP_DATAGRAM_RELIABLE_FLAG)
offset += dissect_reliable_message_index_base(tvb, 3, datagram_tree); /* Calculate RMIB */
- while ((tvb_length_remaining(tvb, offset) > 2) && /* If theres at least 2 bytes available in the buffer */
+ while ((tvb_captured_length_remaining(tvb, offset) > 2) && /* If theres at least 2 bytes available in the buffer */
(dissect_content_length(tvb, offset, NULL) > 0)) /* Empty data Abort */
{
offset += dissect_knet_message(tvb, pinfo, knet_tree, offset, messageindex); /* Call the message subdissector */
diff --git a/epan/dissectors/packet-kpasswd.c b/epan/dissectors/packet-kpasswd.c
index f51cd7d8ef..fd88b7d083 100644
--- a/epan/dissectors/packet-kpasswd.c
+++ b/epan/dissectors/packet-kpasswd.c
@@ -252,7 +252,7 @@ dissect_kpasswd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
*/
col_set_str(pinfo->cinfo, COL_INFO, "Continuation");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -262,7 +262,7 @@ dissect_kpasswd_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
col_clear(pinfo->cinfo, COL_INFO);
tcp_dissect_pdus(tvb, pinfo, tree, kpasswd_desegment, 4, get_krb_pdu_len, dissect_kpasswd_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-l1-events.c b/epan/dissectors/packet-l1-events.c
index bcc6a72297..c6e5ccbb48 100644
--- a/epan/dissectors/packet-l1-events.c
+++ b/epan/dissectors/packet-l1-events.c
@@ -117,7 +117,7 @@ dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c
index 8a4047600c..60bfea8021 100644
--- a/epan/dissectors/packet-l2tp.c
+++ b/epan/dissectors/packet-l2tp.c
@@ -2488,7 +2488,7 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
* as they might not be L2TP packets even though they happen
* to be coming from or going to the L2TP port.
*/
- if (tvb_length(tvb) < 2)
+ if (tvb_captured_length(tvb) < 2)
return 0; /* not enough information to check */
control = tvb_get_ntohs(tvb, 0);
switch (L2TP_VERSION(control)) {
@@ -2540,7 +2540,7 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
/* Call to process l2tp v3 data message */
process_l2tpv3_data_udp(tvb, pinfo, tree, l2tp_conv);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if (LENGTH_BIT(control)) { /* length field included ? */
@@ -2683,13 +2683,13 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
next_tvb = tvb_new_subset_remaining(tvb, idx);
call_dissector(ppp_hdlc_handle, next_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if (LENGTH_BIT(control))
process_control_avps(tvb, pinfo, l2tp_tree, idx, length, -1, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-lanforge.c b/epan/dissectors/packet-lanforge.c
index f214081e6e..f0b32c63b0 100644
--- a/epan/dissectors/packet-lanforge.c
+++ b/epan/dissectors/packet-lanforge.c
@@ -77,7 +77,7 @@ static gboolean dissect_lanforge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
guint32 pld_len, magic;
/* check for min size */
- if(tvb_length(tvb) < 28) { /* Not a LANforge packet. */
+ if(tvb_captured_length(tvb) < 28) { /* Not a LANforge packet. */
return FALSE;
}
@@ -152,7 +152,7 @@ static gboolean dissect_lanforge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
#if 0
if(tvb_reported_length_remaining(tvb, offset) > 0) /* random data */
proto_tree_add_text(lanforge_tree, tvb, offset, -1, "Data (%u bytes)",
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
#else
if(tvb_reported_length_remaining(tvb, offset) > 0) /* random data */
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c
index ecfa566505..8e30cf112b 100644
--- a/epan/dissectors/packet-lapd.c
+++ b/epan/dissectors/packet-lapd.c
@@ -283,7 +283,7 @@ dissect_lapd_bitstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Consume tvb bytes */
- available = tvb_length_remaining(tvb, offset);
+ available = tvb_captured_length_remaining(tvb, offset);
while (offset < available) {
byte = tvb_get_guint8(tvb,offset);
offset++;
@@ -539,11 +539,11 @@ dissect_lapd_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
if (has_crc) {
/* check checksum */
- checksum_offset = tvb_length(tvb) - 2;
+ checksum_offset = tvb_captured_length(tvb) - 2;
checksum = tvb_get_guint8(tvb, checksum_offset); /* high byte */
checksum <<= 8;
checksum |= tvb_get_guint8(tvb, checksum_offset+1) & 0x00FF; /* low byte */
- checksum_calculated = crc16_ccitt_tvb(tvb, tvb_length(tvb) - 2);
+ checksum_calculated = crc16_ccitt_tvb(tvb, tvb_captured_length(tvb) - 2);
checksum_calculated = g_htons(checksum_calculated); /* Note: g_htons() macro may eval arg multiple times */
if (checksum == checksum_calculated) {
@@ -560,7 +560,7 @@ dissect_lapd_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
expert_add_info(pinfo, pi, &ei_lapd_checksum_bad);
}
- next_tvb = tvb_new_subset_length(tvb, lapd_header_len, tvb_length_remaining(tvb,lapd_header_len) - 2);
+ next_tvb = tvb_new_subset_length(tvb, lapd_header_len, tvb_captured_length_remaining(tvb,lapd_header_len) - 2);
} else
next_tvb = tvb_new_subset_remaining(tvb, lapd_header_len);
diff --git a/epan/dissectors/packet-lapdm.c b/epan/dissectors/packet-lapdm.c
index 7a5692d808..e905a95770 100644
--- a/epan/dissectors/packet-lapdm.c
+++ b/epan/dissectors/packet-lapdm.c
@@ -223,7 +223,7 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean is_response = FALSE;
/* Check that there's enough data */
- if (tvb_length(tvb) < LAPDM_HEADER_LEN)
+ if (tvb_captured_length(tvb) < LAPDM_HEADER_LEN)
return;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LAPDm");
@@ -274,7 +274,7 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
len = (length & LAPDM_LEN) >> LAPDM_LEN_SHIFT;
/*n_s = (control & XDLC_N_S_MASK) >> XDLC_N_S_SHIFT;*/
m = (length & LAPDM_M) >> LAPDM_M_SHIFT;
- available_length = tvb_length(tvb) - LAPDM_HEADER_LEN;
+ available_length = tvb_captured_length(tvb) - LAPDM_HEADER_LEN;
/* No point in doing anything if no payload
*/
diff --git a/epan/dissectors/packet-laplink.c b/epan/dissectors/packet-laplink.c
index 0e590154b1..6b7e348931 100644
--- a/epan/dissectors/packet-laplink.c
+++ b/epan/dissectors/packet-laplink.c
@@ -105,7 +105,7 @@ dissect_laplink_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
proto_tree_add_item(laplink_tree, hf_laplink_udp_name, tvb, offset, -1, ENC_ASCII|ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Code to actually dissect the packets - TCP aspects*/
@@ -144,7 +144,7 @@ dissect_laplink_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
/* If this protocol has a sub-dissector call it here, see section 1.8 */
}
@@ -165,7 +165,7 @@ dissect_laplink_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
tcp_dissect_pdus(tvb, pinfo, tree, laplink_desegment,
6, get_laplink_pdu_len,
dissect_laplink_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-lapsat.c b/epan/dissectors/packet-lapsat.c
index acf36b5753..98005bbed1 100644
--- a/epan/dissectors/packet-lapsat.c
+++ b/epan/dissectors/packet-lapsat.c
@@ -440,7 +440,7 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
unsigned int hlen, is_response = 0, plen;
/* Check that there's enough data */
- if (tvb_length(tvb) < LAPSAT_HEADER_LEN)
+ if (tvb_captured_length(tvb) < LAPSAT_HEADER_LEN)
return;
/* Set protocol column */
@@ -496,14 +496,14 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Get the payload */
plen = (addr & LAPSAT_LFI) ?
- tvb_get_guint8(tvb, 3) : tvb_length(tvb) - hlen;
+ tvb_get_guint8(tvb, 3) : tvb_captured_length(tvb) - hlen;
if (!plen)
return; /* No point in doing more if there is no payload */
- DISSECTOR_ASSERT((plen + hlen) <= tvb_length(tvb));
+ DISSECTOR_ASSERT((plen + hlen) <= tvb_captured_length(tvb));
- if ((plen + hlen) == tvb_length(tvb)) {
+ if ((plen + hlen) == tvb_captured_length(tvb)) {
/* Need to integrate the last nibble */
guint8 *data = (guint8 *)tvb_memdup(NULL, tvb, hlen, plen);
data[plen-1] |= tvb_get_guint8(tvb, 2) << 4;
diff --git a/epan/dissectors/packet-lbmc.c b/epan/dissectors/packet-lbmc.c
index 220a1e8a3a..27cd14f62b 100644
--- a/epan/dissectors/packet-lbmc.c
+++ b/epan/dissectors/packet-lbmc.c
@@ -9401,7 +9401,7 @@ static int dissect_nhdr_umq_cmd_resp(tvbuff_t * tvb, int offset, packet_info * p
proto_tree_add_item(subtree, hf_lbmc_umq_cmd_resp_regid, tvb, offset + O_LBMC_CNTL_UMQ_CMD_RESP_HDR_T_REGID, L_LBMC_CNTL_UMQ_CMD_RESP_HDR_T_REGID, ENC_BIG_ENDIAN);
len_dissected = L_LBMC_CNTL_UMQ_CMD_RESP_HDR_T;
resp_type = tvb_get_guint8(tvb, offset + O_LBMC_CNTL_UMQ_CMD_RESP_HDR_T_RESP_TYPE);
- if (tvb_length_remaining(tvb, offset + L_LBMC_CNTL_UMQ_CMD_RESP_HDR_T) > 0)
+ if (tvb_captured_length_remaining(tvb, offset + L_LBMC_CNTL_UMQ_CMD_RESP_HDR_T) > 0)
{
switch (resp_type)
{
diff --git a/epan/dissectors/packet-lcsap.c b/epan/dissectors/packet-lcsap.c
index 100139d97b..e2782fc6da 100644
--- a/epan/dissectors/packet-lcsap.c
+++ b/epan/dissectors/packet-lcsap.c
@@ -785,7 +785,7 @@ dissect_lcsap_PLMN_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, p
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
3, 3, FALSE, &parameter_tvb);
- if(tvb_length(tvb)==0)
+ if(tvb_captured_length(tvb)==0)
return offset;
if (!parameter_tvb)
@@ -2223,28 +2223,28 @@ static int dissect_LCS_AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 1156c240b9..d1f89ab7f1 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -818,7 +818,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
offset=get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
offset=get_ber_length(tvb, offset, &len, &ind);
} else {
- len=tvb_length_remaining(tvb,offset);
+ len=tvb_captured_length_remaining(tvb,offset);
}
if(len==0){
@@ -1151,7 +1151,7 @@ dissect_ldap_LDAPString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
ldap_do_protocolop(actx->pinfo);
if(parameter_tvb)
- ldapstring = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_length_remaining(parameter_tvb, 0), ENC_UTF_8|ENC_NA);
+ ldapstring = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb, 0), ENC_UTF_8|ENC_NA);
if(hf_index == hf_ldap_baseObject) {
/* this is search - put it on the scanline */
@@ -1287,7 +1287,7 @@ char *mechanism = NULL;
* different type and/or mechanism.
*/
if(!actx->pinfo->fd->flags.visited) {
- mechanism = tvb_get_string_enc(NULL, parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
+ mechanism = tvb_get_string_enc(NULL, parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
ldap_info->first_auth_frame = 0; /* not known until we see the bind reply */
/*
* If the mechanism in this request is an empty string (which is
@@ -1336,7 +1336,7 @@ gint32 tag;
* All SPNEGO PDUs are of class CONSTRUCTED while
* GSS PDUs are class APPLICATION
*/
- if (parameter_tvb && (tvb_length(parameter_tvb) > 0))
+ if (parameter_tvb && (tvb_captured_length(parameter_tvb) > 0))
call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree);
}
/*if ((ldap_info->auth_mech != NULL) && ((strcmp(ldap_info->auth_mech, "GSSAPI") == 0) || (ber_class==BER_CLASS_APP))) {*/
@@ -1344,7 +1344,7 @@ gint32 tag;
/*
* This is a raw GSS-API token.
*/
- if (parameter_tvb && (tvb_length(parameter_tvb) > 0)) {
+ if (parameter_tvb && (tvb_captured_length(parameter_tvb) > 0)) {
call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree);
}
}
@@ -1381,7 +1381,7 @@ dissect_ldap_T_ntlmsspNegotiate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
ldap_do_protocolop(actx->pinfo);
call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree);
- offset+=tvb_length_remaining(tvb, offset);
+ offset+=tvb_captured_length_remaining(tvb, offset);
@@ -1397,7 +1397,7 @@ dissect_ldap_T_ntlmsspAuth(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
ldap_do_protocolop(actx->pinfo);
call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree);
- offset+=tvb_length_remaining(tvb, offset);
+ offset+=tvb_captured_length_remaining(tvb, offset);
@@ -1563,7 +1563,7 @@ dissect_ldap_T_bindResponse_matchedDN(gboolean implicit_tag _U_, tvbuff_t *tvb _
offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb);
if( new_tvb
- && (tvb_length(new_tvb)>=7)
+ && (tvb_captured_length(new_tvb)>=7)
&& (!tvb_memeql(new_tvb, 0, "NTLMSSP", 7))){
/* make sure the protocol op comes first */
@@ -1668,7 +1668,7 @@ ldap_conv_info_t *ldap_info;
* which might not be wrapped in GSS-SPNEGO but be a raw
* NTLMSSP blob
*/
- if ( (tvb_length(parameter_tvb)>=7)
+ if ( (tvb_captured_length(parameter_tvb)>=7)
&& (!tvb_memeql(parameter_tvb, 0, "NTLMSSP", 7))){
call_dissector(ntlmssp_handle, parameter_tvb, actx->pinfo, tree);
break;
@@ -1676,14 +1676,14 @@ ldap_conv_info_t *ldap_info;
/*
* This is a GSS-API token.
*/
- if(parameter_tvb && (tvb_length(parameter_tvb) > 0))
+ if(parameter_tvb && (tvb_captured_length(parameter_tvb) > 0))
call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree);
} else if (ldap_info->auth_mech != NULL &&
strcmp(ldap_info->auth_mech, "GSSAPI") == 0) {
/*
* This is a GSS-API token.
*/
- if(parameter_tvb && (tvb_length(parameter_tvb) > 0))
+ if(parameter_tvb && (tvb_captured_length(parameter_tvb) > 0))
call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree);
}
break;
@@ -1857,7 +1857,7 @@ dissect_ldap_T_and(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
and_filter_string=NULL;
if(tree){
- it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "and: ");
+ it=proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "and: ");
tr=proto_item_add_subtree(it, ett_ldap_T_and);
tree = tr;
}
@@ -1909,7 +1909,7 @@ dissect_ldap_T_or(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
or_filter_string=NULL;
if(tree){
- it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "or: ");
+ it=proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "or: ");
tr=proto_item_add_subtree(it, ett_ldap_T_or);
tree = tr;
}
@@ -2053,7 +2053,7 @@ dissect_ldap_SubstringFilter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
substring_item_any=NULL;
substring_item_final=NULL;
if(tree){
- it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "substring: ");
+ it=proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "substring: ");
tr=proto_item_add_subtree(it, ett_ldap_SubstringFilter);
tree = tr;
}
@@ -2247,7 +2247,7 @@ dissect_ldap_Filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_
}
if(tree){
- it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Filter: ");
+ it=proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Filter: ");
tr=proto_item_add_subtree(it, ett_ldap_Filter);
tree = tr;
}
@@ -2348,7 +2348,7 @@ dissect_ldap_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
/* first check if we have a custom attribute type configured */
if ((hf_id = get_hf_for_header (attr_type)) != NULL)
- proto_tree_add_item (tree, *hf_id, next_tvb, 0, tvb_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA);
+ proto_tree_add_item (tree, *hf_id, next_tvb, 0, tvb_captured_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA);
/* if we have an attribute type that isn't binary see if there is a better dissector */
else if(!attr_type || !next_tvb || !dissector_try_string(ldap_name_dissector_table, attr_type, next_tvb, actx->pinfo, tree, NULL)) {
@@ -2359,14 +2359,14 @@ dissect_ldap_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
NULL);
- len = tvb_length_remaining(next_tvb, 0);
+ len = tvb_captured_length_remaining(next_tvb, 0);
for(i = 0; i < len; i++)
if(!g_ascii_isprint(tvb_get_guint8(next_tvb, i)))
break;
if(i == len) {
- string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_length_remaining(next_tvb, 0), ENC_ASCII|ENC_NA);
+ string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_captured_length_remaining(next_tvb, 0), ENC_ASCII|ENC_NA);
proto_item_set_text(actx->created_item, "AttributeValue: %s", string);
}
}
@@ -2870,7 +2870,7 @@ dissect_ldap_LDAPOID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
if (!parameter_tvb)
return offset;
- object_identifier_id = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
+ object_identifier_id = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
name = oid_resolved_from_string(object_identifier_id);
if(name){
@@ -3428,7 +3428,7 @@ dissect_ldap_DirSyncFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
dissect_ber_identifier(actx->pinfo, tree, tvb, otheroffset, &ber_class, &pc, &tag);
otheroffset=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;
}
@@ -3908,7 +3908,7 @@ one_more_pdu:
/* If this was a sasl blob there might be another PDU following in the
* same blob
*/
- if(tvb_length_remaining(tvb, offset)>=6){
+ if(tvb_captured_length_remaining(tvb, offset)>=6){
tvb = tvb_new_subset_remaining(tvb, offset);
offset = 0;
@@ -4115,7 +4115,7 @@ static void
* the token, from which we compute the offset in the tvbuff at
* which the plaintext data, i.e. the LDAP message, begins.
*/
- tmp_length = tvb_length_remaining(sasl_tvb, 4);
+ tmp_length = tvb_captured_length_remaining(sasl_tvb, 4);
if ((guint)tmp_length > sasl_len)
tmp_length = sasl_len;
gssapi_tvb = tvb_new_subset(sasl_tvb, 4, tmp_length, sasl_len);
@@ -4367,7 +4367,7 @@ static void dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
/* Get the length of the buffer */
- len=tvb_length_remaining(tvb,offset);
+ len=tvb_captured_length_remaining(tvb,offset);
/* check the len if it is to small return */
if (len < 10) return;
@@ -4386,7 +4386,7 @@ static void dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
switch(itype){
case LOGON_SAM_LOGON_RESPONSE:
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
/* logon server name */
fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
proto_tree_add_string(tree, hf_mscldap_nb_hostname, tvb,offset, fn_len, fn);
@@ -4566,7 +4566,7 @@ static int
dissect_sasl_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -4588,7 +4588,7 @@ static int
dissect_normal_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -4602,7 +4602,7 @@ dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
* proto_tree_add_oid() instead.
*/
- oid=tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_length(tvb), ENC_UTF_8|ENC_NA);
+ oid=tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_captured_length(tvb), ENC_UTF_8|ENC_NA);
if(!oid){
return;
}
@@ -4610,9 +4610,9 @@ dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
oidname=oid_resolved_from_string(oid);
if(oidname){
- proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s (%s)",oid,oidname);
+ proto_tree_add_text(tree, tvb, 0, tvb_captured_length(tvb), "OID: %s (%s)",oid,oidname);
} else {
- proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s",oid);
+ proto_tree_add_text(tree, tvb, 0, tvb_captured_length(tvb), "OID: %s",oid);
}
}
@@ -4694,7 +4694,7 @@ struct access_mask_info ldap_access_mask_info = {
static void
dissect_ldap_nt_sec_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- dissect_nt_sec_desc(tvb, 0, pinfo, tree, NULL, TRUE, tvb_length(tvb), &ldap_access_mask_info);
+ dissect_nt_sec_desc(tvb, 0, pinfo, tree, NULL, TRUE, tvb_captured_length(tvb), &ldap_access_mask_info);
}
static void
@@ -4780,7 +4780,7 @@ dissect_ldap_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
this_was_not_sasl:
/* check if it is a normal BER encoded LDAP packet
@@ -4860,16 +4860,16 @@ this_was_not_normal_ldap:
dissector_add_uint("tcp.port", tcp_port, ldap_handle);
/* we are done */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Ok it might be a strange case of SASL still
* It has been seen with Exchange setup to MS AD
* when Exchange pretend that there is SASL but in fact data are still
* in clear*/
- if ((sasl_len + 4) == (guint32)tvb_length_remaining(tvb, 0))
+ if ((sasl_len + 4) == (guint32)tvb_captured_length_remaining(tvb, 0))
tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
end:
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c
index 1c58bcc98a..20b4bfd922 100644
--- a/epan/dissectors/packet-ldp.c
+++ b/epan/dissectors/packet-ldp.c
@@ -2924,7 +2924,7 @@ dissect_ldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
* packets that happen to be going to or from the
* LDP port but that aren't LDP packets.
*/
- if (tvb_length(tvb) < 2) {
+ if (tvb_captured_length(tvb) < 2) {
/*
* Not enough information to tell.
*/
@@ -2942,7 +2942,7 @@ dissect_ldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
/*
* XXX - return minimum of this and the length of the PDU?
*/
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -3158,7 +3158,7 @@ dissect_ldp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
void *pd_save;
while (tvb_reported_length_remaining(tvb, offset) != 0) {
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
/*
* Make sure the first PDU has a version number of 1;
@@ -3290,7 +3290,7 @@ dissect_ldp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
*/
offset += plen + 4;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register all the bits needed with the filtering engine */
diff --git a/epan/dissectors/packet-ldss.c b/epan/dissectors/packet-ldss.c
index 29b69e7274..779c7efcf9 100644
--- a/epan/dissectors/packet-ldss.c
+++ b/epan/dissectors/packet-ldss.c
@@ -332,7 +332,7 @@ dissect_ldss_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* instead of just filling out the columns), then give more detail. */
if (tree) {
ti = proto_tree_add_item(tree, proto_ldss,
- tvb, 0, (tvb_length(tvb) > 72) ? tvb_length(tvb) : 72, ENC_NA);
+ tvb, 0, (tvb_captured_length(tvb) > 72) ? tvb_captured_length(tvb) : 72, ENC_NA);
ldss_tree = proto_item_add_subtree(ti, ett_ldss_broadcast);
proto_tree_add_item(ldss_tree, hf_ldss_message_id,
@@ -386,9 +386,9 @@ dissect_ldss_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, 68, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ldss_tree, hf_ldss_property_count,
tvb, 70, 2, ENC_BIG_ENDIAN);
- if (tvb_length(tvb) > 72) {
+ if (tvb_captured_length(tvb) > 72) {
proto_tree_add_item(ldss_tree, hf_ldss_properties,
- tvb, 72, tvb_length(tvb) - 72, ENC_NA);
+ tvb, 72, tvb_captured_length(tvb) - 72, ENC_NA);
}
}
@@ -437,7 +437,7 @@ dissect_ldss_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
highest_num_seen = pinfo->fd->num;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Transfers happen in response to broadcasts, they are always TCP and are
@@ -671,7 +671,7 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
* Always desegment if the size is 0 (ie. unknown)
*/
if (pinfo->can_desegment) {
- if (size == 0 || tvb_length(tvb) < size) {
+ if (size == 0 || tvb_captured_length(tvb) < size) {
pinfo->desegment_offset = 0;
pinfo->desegment_len = DESEGMENT_UNTIL_FIN;
return 0;
@@ -692,16 +692,16 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
tvb, 0, tvb_reported_length(tvb), ENC_NA);
ldss_tree = proto_item_add_subtree(ti, ett_ldss_transfer);
proto_tree_add_bytes_format(ldss_tree, hf_ldss_file_data,
- tvb, 0, tvb_length(tvb), NULL,
+ tvb, 0, tvb_captured_length(tvb), NULL,
compression == COMPRESSION_GZIP
? "Gzip compressed data: %d bytes"
: "File data: %d bytes",
- tvb_length(tvb));
+ tvb_captured_length(tvb));
#ifdef HAVE_LIBZ
/* Be nice and uncompress the file data. */
if (compression == COMPRESSION_GZIP) {
tvbuff_t *uncomp_tvb;
- uncomp_tvb = tvb_child_uncompress(tvb, tvb, 0, tvb_length(tvb));
+ uncomp_tvb = tvb_child_uncompress(tvb, tvb, 0, tvb_captured_length(tvb));
if (uncomp_tvb != NULL) {
/* XXX: Maybe not a good idea to add a data_source for
what may very well be a large buffer since then
@@ -712,9 +712,9 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
*/
add_new_data_source(pinfo, uncomp_tvb, "Uncompressed Data");
proto_tree_add_bytes_format_value(ldss_tree, hf_ldss_file_data,
- uncomp_tvb, 0, tvb_length(uncomp_tvb),
+ uncomp_tvb, 0, tvb_captured_length(uncomp_tvb),
NULL, "Uncompressed data: %d bytes",
- tvb_length(uncomp_tvb));
+ tvb_captured_length(uncomp_tvb));
}
}
#endif
@@ -787,7 +787,7 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
prepare_ldss_transfer_conv(transfer_info->broadcast);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
diff --git a/epan/dissectors/packet-lg8979.c b/epan/dissectors/packet-lg8979.c
index 12c1aeb52a..bfe3dd44e5 100644
--- a/epan/dissectors/packet-lg8979.c
+++ b/epan/dissectors/packet-lg8979.c
@@ -377,7 +377,7 @@ classify_lg8979_packet(tvbuff_t *tvb)
{
guint8 func, len, data_len, flags;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/* If TVB length is equal to 5, this is classifed as a 'short response message' */
/* and is guaranteed to be RTU->Master only */
if (len == 5) {
@@ -510,7 +510,7 @@ dissect_lg8979(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
col_set_str(pinfo->cinfo, COL_PROTOCOL, "L&G 8979");
col_clear(pinfo->cinfo, COL_INFO);
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
lg8979_item = proto_tree_add_protocol_format(tree, proto_lg8979, tvb, 0, len, "Landis & Gyr Telegyr 8979");
lg8979_tree = proto_item_add_subtree(lg8979_item, ett_lg8979);
@@ -779,7 +779,7 @@ dissect_lg8979(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
offset += 1;
/* If this is not a short response, and there are at least 2 bytes remaining continue to process function codes */
- while ((!shr) && (tvb_length_remaining(tvb, offset) > 2)){
+ while ((!shr) && (tvb_captured_length_remaining(tvb, offset) > 2)){
/* Add Function Code & last Mark Block to Protocol Tree */
/* Function code is 7 lower bits of byte , LMB is 8th bit*/
@@ -1192,7 +1192,7 @@ dissect_lg8979(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
} /* packet type */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1204,7 +1204,7 @@ get_lg8979_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_)
{
guint len;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
return len;
}
@@ -1216,7 +1216,7 @@ static int
dissect_lg8979_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
/* Check for a L&G8979 packet. It should begin with 0xFF */
if(length < 2 || tvb_get_guint8(tvb, 0) != 0xFF) {
@@ -1227,7 +1227,7 @@ dissect_lg8979_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
tcp_dissect_pdus(tvb, pinfo, tree, lg8979_desegment, 1,
get_lg8979_len, dissect_lg8979, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1237,7 +1237,7 @@ dissect_lg8979_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
static int
dissect_lg8979_simple(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
/* Check for a L&G8979 packet. It should begin with 0xFF */
if(length < 2 || tvb_get_guint8(tvb, 0) != 0xFF) {
@@ -1247,7 +1247,7 @@ dissect_lg8979_simple(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
dissect_lg8979(tvb, pinfo, tree, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/******************************************************************************************************/
diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c
index 225f0d15ec..7926ebc87c 100644
--- a/epan/dissectors/packet-llc.c
+++ b/epan/dissectors/packet-llc.c
@@ -515,7 +515,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"Response" : "Command"
);
- if (tvb_length_remaining(tvb, llc_header_len) > 0) {
+ if (tvb_captured_length_remaining(tvb, llc_header_len) > 0) {
next_tvb = tvb_new_subset_remaining(tvb, llc_header_len);
if (XDLC_IS_INFORMATION(control)) {
/*
diff --git a/epan/dissectors/packet-llrp.c b/epan/dissectors/packet-llrp.c
index da667bdcf0..6ce44cfecf 100644
--- a/epan/dissectors/packet-llrp.c
+++ b/epan/dissectors/packet-llrp.c
@@ -2640,7 +2640,7 @@ dissect_llrp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
if (try_val_to_str_ext(type, &message_types_ext))
dissect_llrp_message(tvb, pinfo, llrp_tree, type, offset);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Determine length of LLRP message */
@@ -2657,7 +2657,7 @@ dissect_llrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, LLRP_HEADER_LENGTH,
get_llrp_message_len, dissect_llrp_packet, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-lmp.c b/epan/dissectors/packet-lmp.c
index 8e96ad3b0e..086cd9427e 100644
--- a/epan/dissectors/packet-lmp.c
+++ b/epan/dissectors/packet-lmp.c
@@ -732,14 +732,14 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
} else {
expert_add_info_format(pinfo, msg_item, &ei_lmp_invalid_msg_type,
"Invalid message type: %u", message_type);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if (lmp_checksum_config) {
cksum = tvb_get_ntohs(tvb, offset+6);
ti = proto_tree_add_item(lmp_header_tree, hf_lmp_filter[LMPF_CHECKSUM], tvb,
offset+6, 2, ENC_BIG_ENDIAN);
- if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {
+ if (!pinfo->fragmented && (int) tvb_captured_length(tvb) >= msg_length) {
/* 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, msg_length);
cksum_vec[0].len = msg_length;
@@ -781,7 +781,7 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
} else {
expert_add_info_format(pinfo, hidden_item, &ei_lmp_invalid_class,
"Invalid class: %u", lmp_class);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
lmp_object_tree = proto_item_add_subtree(ti, lmp_class_to_subtree(lmp_class));
@@ -1993,7 +1993,7 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
} /* while */
} /* tree */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
lmp_prefs_applied (void)
diff --git a/epan/dissectors/packet-logcat.c b/epan/dissectors/packet-logcat.c
index f52b75b4ba..4f8427760c 100644
--- a/epan/dissectors/packet-logcat.c
+++ b/epan/dissectors/packet-logcat.c
@@ -174,7 +174,7 @@ dissect_logcat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
check_length += string_length;
if (length != check_length)
- proto_tree_add_expert(maintree, pinfo, &ei_invalid_payload_length, tvb, offset, tvb_length_remaining(tvb, offset));
+ proto_tree_add_expert(maintree, pinfo, &ei_invalid_payload_length, tvb, offset, tvb_captured_length_remaining(tvb, offset));
if (have_tap_listener(exported_pdu_tap)) {
exp_pdu_data_t *exp_pdu_data;
diff --git a/epan/dissectors/packet-loop.c b/epan/dissectors/packet-loop.c
index 19a953120d..668bb129ae 100644
--- a/epan/dissectors/packet-loop.c
+++ b/epan/dissectors/packet-loop.c
@@ -116,7 +116,7 @@ dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "No valid function found");
}
- if (tvb_length_remaining(tvb, offset) > 0)
+ if (tvb_captured_length_remaining(tvb, offset) > 0)
{
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-lppa.c b/epan/dissectors/packet-lppa.c
index 73cd0d9b79..82e9f1bc94 100644
--- a/epan/dissectors/packet-lppa.c
+++ b/epan/dissectors/packet-lppa.c
@@ -2308,22 +2308,22 @@ static int dissect_PrivateMessage_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lppa_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lppa_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lppa_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lppa_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lppa_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lppa_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lppa_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lppa_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
/*--- proto_register_lppa -------------------------------------------*/
diff --git a/epan/dissectors/packet-lsc.c b/epan/dissectors/packet-lsc.c
index 278018eb75..7faae22c98 100644
--- a/epan/dissectors/packet-lsc.c
+++ b/epan/dissectors/packet-lsc.c
@@ -146,7 +146,7 @@ dissect_lsc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
col_clear(pinfo->cinfo, COL_INFO);
/* Too little data? */
- if (tvb_length(tvb) < LSC_MIN_LEN)
+ if (tvb_captured_length(tvb) < LSC_MIN_LEN)
{
col_set_str(pinfo->cinfo, COL_INFO, "[Too short]");
return 0;
@@ -198,9 +198,9 @@ dissect_lsc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
val_to_str(op_code, op_code_vals, "Unknown op code (0x%x)"),
stream);
- if (tvb_length(tvb) < expected_len)
+ if (tvb_captured_length(tvb) < expected_len)
col_append_str(pinfo->cinfo, COL_INFO, " [Too short]");
- else if (tvb_length(tvb) > expected_len)
+ else if (tvb_captured_length(tvb) > expected_len)
col_append_str(pinfo->cinfo, COL_INFO, " [Too long]");
if (tree) {
@@ -271,7 +271,7 @@ dissect_lsc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Decode LSC over UDP */
@@ -335,7 +335,7 @@ dissect_lsc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, LSC_OPCODE_LEN, get_lsc_pdu_len,
dissect_lsc_common, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-ltp.c b/epan/dissectors/packet-ltp.c
index 4738ab7813..56602bb491 100644
--- a/epan/dissectors/packet-ltp.c
+++ b/epan/dissectors/packet-ltp.c
@@ -243,14 +243,14 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int
client_id = evaluate_sdnv_64(tvb,frame_offset + segment_offset,&client_id_size);
segment_offset+= client_id_size;
- if((unsigned)(frame_offset + segment_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + segment_offset) >= tvb_captured_length(tvb)){
/* This would mean the data segment is incomplete */
return 0;
}
offset = evaluate_sdnv_64(tvb,frame_offset + segment_offset,&offset_size);
segment_offset+= offset_size;
- if((unsigned)(frame_offset + segment_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + segment_offset) >= tvb_captured_length(tvb)){
/* This would mean the data segment is incomplete */
return 0;
}
@@ -258,7 +258,7 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int
length = evaluate_sdnv_64(tvb,frame_offset + segment_offset,&length_size);
segment_offset+= length_size;
- if((unsigned)(frame_offset + segment_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + segment_offset) >= tvb_captured_length(tvb)){
/* This would mean the data segment is incomplete */
return 0;
}
@@ -268,7 +268,7 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int
chkp_sno = evaluate_sdnv_64(tvb,frame_offset + segment_offset,&chkp_sno_size);
segment_offset+= chkp_sno_size;
- if((unsigned)(frame_offset + segment_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + segment_offset) >= tvb_captured_length(tvb)){
/* This would mean the data segment is incomplete */
return 0;
}
@@ -276,7 +276,7 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int
rpt_sno = evaluate_sdnv_64(tvb,frame_offset + segment_offset,&rpt_sno_size);
segment_offset+= rpt_sno_size;
- if((unsigned)(frame_offset + segment_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + segment_offset) >= tvb_captured_length(tvb)){
/* This would mean the data segment is incomplete */
return 0;
}
@@ -292,7 +292,7 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int
/* Addition result has wrapped */
return 0;
}
- if((unsigned)(frame_offset + segment_offset) > tvb_length(tvb)){
+ if((unsigned)(frame_offset + segment_offset) > tvb_captured_length(tvb)){
/* This would mean the data segment is incomplete */
return 0;
}
@@ -354,13 +354,13 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int
if(new_tvb)
{
- data_length = tvb_length(new_tvb);
+ data_length = tvb_captured_length(new_tvb);
while(dissected_data_size < data_length)
{
ltp_data_data_item = proto_tree_add_text(ltp_data_tree, tvb,frame_offset, 0, "Data[%d]",data_count);
ltp_data_data_tree = proto_item_add_subtree(ltp_data_data_item, ett_data_data_segm);
- datatvb = tvb_new_subset(new_tvb, data_offset, (int)data_length - dissected_data_size, tvb_length(new_tvb));
+ datatvb = tvb_new_subset(new_tvb, data_offset, (int)data_length - dissected_data_size, tvb_captured_length(new_tvb));
bundle_size = call_dissector(bundle_handle, datatvb, pinfo, ltp_data_data_tree);
if(bundle_size == 0) { /*Couldn't parse bundle*/
col_set_str(pinfo->cinfo, COL_INFO, "Dissection Failed");
@@ -447,11 +447,11 @@ dissect_report_segment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ltp_tree,
* max number of claims we can possibly squeeze into the remaining tvbuff, then
* the packet is malformed.
*/
- if (rcpt_clm_cnt > tvb_length_remaining(tvb, frame_offset + segment_offset) / 2) {
+ if (rcpt_clm_cnt > tvb_captured_length_remaining(tvb, frame_offset + segment_offset) / 2) {
proto_item_set_end(ltp_rpt_item, tvb, frame_offset + segment_offset);
expert_add_info_format(pinfo, ltp_tree, &ei_ltp_mal_reception_claim,
"Reception claim count impossibly large: %d > %d", rcpt_clm_cnt,
- tvb_length_remaining(tvb, frame_offset + segment_offset) / 2);
+ tvb_captured_length_remaining(tvb, frame_offset + segment_offset) / 2);
return 0;
}
proto_tree_add_uint(ltp_rpt_tree, hf_ltp_rpt_clm_cnt, tvb, frame_offset + segment_offset, rcpt_clm_cnt_size, rcpt_clm_cnt);
@@ -492,7 +492,7 @@ dissect_report_ack_segment(proto_tree *ltp_tree, tvbuff_t *tvb,int frame_offset)
rpt_sno = evaluate_sdnv_64(tvb,frame_offset, &rpt_sno_size);
segment_offset += rpt_sno_size;
- if((unsigned)(frame_offset + segment_offset) > tvb_length(tvb)){
+ if((unsigned)(frame_offset + segment_offset) > tvb_captured_length(tvb)){
return 0;
}
@@ -544,17 +544,17 @@ dissect_header_extn(proto_tree *ltp_tree, tvbuff_t *tvb,int frame_offset,int hdr
extn_type[i] = tvb_get_guint8(tvb,frame_offset);
extn_offset++;
- if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + extn_offset) >= tvb_captured_length(tvb)){
return 0;
}
length[i] = evaluate_sdnv_64(tvb,frame_offset,&length_size[i]);
extn_offset += length_size[i];
- if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + extn_offset) >= tvb_captured_length(tvb)){
return 0;
}
value[i] = evaluate_sdnv_64(tvb,frame_offset,&value_size[i]);
extn_offset += value_size[i];
- if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + extn_offset) >= tvb_captured_length(tvb)){
return 0;
}
}
@@ -594,21 +594,21 @@ dissect_trailer_extn(proto_tree *ltp_tree, tvbuff_t *tvb,int frame_offset,int tr
extn_type[i] = tvb_get_guint8(tvb,frame_offset);
extn_offset++;
- if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + extn_offset) >= tvb_captured_length(tvb)){
return 0;
}
length[i] = evaluate_sdnv_64(tvb,frame_offset,&length_size[i]);
extn_offset += length_size[i];
- if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + extn_offset) >= tvb_captured_length(tvb)){
return 0;
}
value[i] = evaluate_sdnv_64(tvb,frame_offset,&value_size[i]);
extn_offset += value_size[i];
- if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+ if((unsigned)(frame_offset + extn_offset) >= tvb_captured_length(tvb)){
return 0;
}
}
@@ -657,7 +657,7 @@ dissect_ltp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
proto_tree *ltp_session_tree = NULL;
/* Check that there's enough data */
- if(tvb_length(tvb) < LTP_MIN_DATA_BUFFER){
+ if(tvb_captured_length(tvb) < LTP_MIN_DATA_BUFFER){
return 0;
}
frame_offset = 0;
@@ -671,14 +671,14 @@ dissect_ltp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
engine_id = evaluate_sdnv_64(tvb,frame_offset + header_offset,&engine_id_size);
header_offset += engine_id_size;
- if((unsigned)header_offset >= tvb_length(tvb)){
+ if((unsigned)header_offset >= tvb_captured_length(tvb)){
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
return 0;
}
session_num = evaluate_sdnv_64(tvb,frame_offset + header_offset,&session_num_size);
header_offset += session_num_size;
- if((unsigned)header_offset >= tvb_length(tvb)){
+ if((unsigned)header_offset >= tvb_captured_length(tvb)){
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
return 0;
}
@@ -715,7 +715,7 @@ dissect_ltp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(ltp_type,ltp_type_col_info,"Protocol Error"));
- if((unsigned)frame_offset >= tvb_length(tvb)){
+ if((unsigned)frame_offset >= tvb_captured_length(tvb)){
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
return 0;
}
@@ -730,7 +730,7 @@ dissect_ltp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
frame_offset += hdr_extn_offset;
}
- if((unsigned)frame_offset >= tvb_length(tvb)){
+ if((unsigned)frame_offset >= tvb_captured_length(tvb)){
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
return 0;
}
@@ -767,7 +767,7 @@ dissect_ltp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
frame_offset += segment_offset;
/* Check to see if there are any trailer extensions */
if(trl_extn_cnt > 0){
- if((unsigned)frame_offset >= tvb_length(tvb)){
+ if((unsigned)frame_offset >= tvb_captured_length(tvb)){
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
return 0;
}
@@ -778,7 +778,7 @@ dissect_ltp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
}
}
/* 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-m2pa.c b/epan/dissectors/packet-m2pa.c
index 7ffc180867..6b2023541c 100644
--- a/epan/dissectors/packet-m2pa.c
+++ b/epan/dissectors/packet-m2pa.c
@@ -228,7 +228,7 @@ dissect_v2_user_data_message(tvbuff_t *message_data_tvb, packet_info *pinfo, pro
proto_tree *m2pa_li_tree;
tvbuff_t *payload_tvb;
- if (tvb_length(message_data_tvb) > 0) {
+ if (tvb_captured_length(message_data_tvb) > 0) {
if (m2pa_tree) {
m2pa_li_item = proto_tree_add_text(m2pa_tree, message_data_tvb, LI_OFFSET, LI_LENGTH, "Length Indicator");
m2pa_li_tree = proto_item_add_subtree(m2pa_li_item, ett_m2pa_li);
@@ -255,7 +255,7 @@ dissect_v8_user_data_message(tvbuff_t *message_data_tvb, packet_info *pinfo, pro
proto_tree *m2pa_li_tree;
tvbuff_t *payload_tvb;
- if (tvb_length(message_data_tvb) > 0) {
+ if (tvb_captured_length(message_data_tvb) > 0) {
if (m2pa_tree) {
m2pa_li_item = proto_tree_add_text(m2pa_tree, message_data_tvb, LI_OFFSET, LI_LENGTH, "Length Indicator");
m2pa_li_tree = proto_item_add_subtree(m2pa_li_item, ett_m2pa_li);
@@ -284,7 +284,7 @@ dissect_user_data_message(tvbuff_t *message_data_tvb, packet_info *pinfo, proto_
proto_tree *m2pa_li_tree;
tvbuff_t *payload_tvb;
- if (tvb_length(message_data_tvb) > 0) {
+ if (tvb_captured_length(message_data_tvb) > 0) {
if (m2pa_tree) {
m2pa_li_item = proto_tree_add_text(m2pa_tree, message_data_tvb, PRI_OFFSET, PRI_LENGTH, "Priority");
m2pa_li_tree = proto_item_add_subtree(m2pa_li_item, ett_m2pa_li);
@@ -338,7 +338,7 @@ dissect_v8_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, p
col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v8_link_status_values, "Unknown"));
- filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
+ filler_length = tvb_captured_length(message_data_tvb) - STATUS_LENGTH;
proto_tree_add_item(m2pa_tree, hf_v8_status, message_data_tvb, STATUS_OFFSET, STATUS_LENGTH, ENC_BIG_ENDIAN);
if (filler_length > 0)
@@ -364,7 +364,7 @@ dissect_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, prot
col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), link_status_values, "Unknown"));
- filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
+ filler_length = tvb_captured_length(message_data_tvb) - STATUS_LENGTH;
proto_tree_add_item(m2pa_tree, hf_status, message_data_tvb, STATUS_OFFSET, STATUS_LENGTH, ENC_BIG_ENDIAN);
if (filler_length > 0)
@@ -376,7 +376,7 @@ dissect_unknown_message(tvbuff_t *message_data_tvb, proto_tree *m2pa_tree)
{
guint length;
- length = tvb_length(message_data_tvb);
+ length = tvb_captured_length(message_data_tvb);
if ((m2pa_tree) && (length > 0))
proto_tree_add_item(m2pa_tree, hf_unknown_data, message_data_tvb, 0, length, ENC_NA);
}
diff --git a/epan/dissectors/packet-m2ua.c b/epan/dissectors/packet-m2ua.c
index 95ec7a62a1..8579bf4f4d 100644
--- a/epan/dissectors/packet-m2ua.c
+++ b/epan/dissectors/packet-m2ua.c
@@ -885,10 +885,10 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tree,
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
/* calculate padding and total length */
- 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(m2ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s",
+ parameter_item = proto_tree_add_text(m2ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, 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_m2ua_parameter);
diff --git a/epan/dissectors/packet-m3ap.c b/epan/dissectors/packet-m3ap.c
index 34c62e30ed..0c14e90e88 100644
--- a/epan/dissectors/packet-m3ap.c
+++ b/epan/dissectors/packet-m3ap.c
@@ -587,7 +587,7 @@ dissect_m3ap_Absolute_Time_ofMBMS_Data(tvbuff_t *tvb _U_, int offset _U_, asn1_c
if (!parameter_tvb)
return offset;
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
time_str = tvb_ntp_fmt_ts(parameter_tvb, 0);
proto_tree_add_string(tree, hf_m3ap_Absolute_Time_ofMBMS_Data_value, parameter_tvb, 0, tvb_len, time_str);
@@ -955,7 +955,7 @@ dissect_m3ap_IPAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
if (!parameter_tvb)
return offset;
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
proto_tree_add_item(tree, hf_m3ap_IPAddress, parameter_tvb, 0, tvb_len, ENC_NA);
@@ -1049,7 +1049,7 @@ dissect_m3ap_MBMS_Service_Area(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
if (!parameter_tvb)
return offset;
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
dissect_gtpv2_mbms_service_area(parameter_tvb, actx->pinfo, tree, actx->created_item, tvb_len, 0, 0);
@@ -1071,7 +1071,7 @@ dissect_m3ap_MBMS_Session_Duration(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
if (!parameter_tvb)
return offset;
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
proto_item_append_text(actx->created_item, " ");
dissect_gtpv2_mbms_session_duration(parameter_tvb, actx->pinfo, tree, actx->created_item, tvb_len, 0, 0);
@@ -1115,7 +1115,7 @@ dissect_m3ap_MinimumTimeToMBMSDataTransfer(tvbuff_t *tvb _U_, int offset _U_, as
if (!parameter_tvb)
return offset;
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
dissect_gtpv2_mbms_time_to_data_xfer(parameter_tvb, actx->pinfo, tree, actx->created_item, tvb_len, 0, 0);
@@ -2007,27 +2007,27 @@ static int dissect_M3AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c
index a7637c2ffb..8408408186 100644
--- a/epan/dissectors/packet-m3ua.c
+++ b/epan/dissectors/packet-m3ua.c
@@ -1390,13 +1390,13 @@ dissect_v5_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tr
/* 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;
if (!tree && tag != V5_PROTOCOL_DATA_PARAMETER_TAG)
return; /* Nothing to do here */
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, v5_parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s", val_to_str_const(tag, v5_parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_parameter);
/* add tag and length to the parameter tree */
@@ -1517,13 +1517,13 @@ dissect_v6_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tr
/* 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;
if (!tree && tag != V6_PROTOCOL_DATA_1_PARAMETER_TAG && tag != V6_PROTOCOL_DATA_2_PARAMETER_TAG)
return; /* Nothing to do here */
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, v6_parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s", val_to_str_const(tag, v6_parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_parameter);
/* add tag and length to the parameter tree */
@@ -1684,13 +1684,13 @@ dissect_v7_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tr
/* 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;
if (!tree && tag != V7_PROTOCOL_DATA_1_PARAMETER_TAG && tag != V7_PROTOCOL_DATA_2_PARAMETER_TAG)
return; /* Nothing to do here */
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, v7_parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s", val_to_str_const(tag, v7_parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_parameter);
/* add tag and length to the parameter tree */
@@ -1850,14 +1850,14 @@ 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;
if (!tree && tag != PROTOCOL_DATA_PARAMETER_TAG)
return; /* Nothing to do here */
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(m3ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, 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_parameter);
/* add tag and length to the parameter tree */
@@ -1956,7 +1956,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-mac-lte-framed.c b/epan/dissectors/packet-mac-lte-framed.c
index c3cf7a94fe..1d2420b7b5 100644
--- a/epan/dissectors/packet-mac-lte-framed.c
+++ b/epan/dissectors/packet-mac-lte-framed.c
@@ -56,7 +56,7 @@ static void dissect_mac_lte_framed(tvbuff_t *tvb, packet_info *pinfo,
- fixed header bytes
- tag for data
- at least one byte of MAC PDU payload */
- if ((size_t)tvb_length_remaining(tvb, offset) < (3+2)) {
+ if ((size_t)tvb_captured_length_remaining(tvb, offset) < (3+2)) {
return;
}
diff --git a/epan/dissectors/packet-macsec.c b/epan/dissectors/packet-macsec.c
index b759cd8d4a..3770b99a39 100644
--- a/epan/dissectors/packet-macsec.c
+++ b/epan/dissectors/packet-macsec.c
@@ -85,12 +85,12 @@ static int dissect_macsec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
}
/* Check for short length */
- if (tvb_length(tvb) <= (sectag_length + icv_length)) {
+ if (tvb_captured_length(tvb) <= (sectag_length + icv_length)) {
return 0;
}
data_offset = sectag_length;
- data_length = tvb_length(tvb) - sectag_length - icv_length;
+ data_length = tvb_captured_length(tvb) - sectag_length - icv_length;
icv_offset = data_length + data_offset;
next_tvb = tvb_new_subset_length(tvb, data_offset, data_length);
@@ -139,7 +139,7 @@ static int dissect_macsec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
icv_length, ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-mactelnet.c b/epan/dissectors/packet-mactelnet.c
index e13c507084..f7e5092e6f 100644
--- a/epan/dissectors/packet-mactelnet.c
+++ b/epan/dissectors/packet-mactelnet.c
@@ -116,7 +116,7 @@ dissect_mactelnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
guint16 type;
/* Check that there's enough data */
- if (tvb_length(tvb) < 18)
+ if (tvb_captured_length(tvb) < 18)
return 0;
/* Get the type byte */
diff --git a/epan/dissectors/packet-mbtcp.c b/epan/dissectors/packet-mbtcp.c
index 75687b560e..5cc6a3473a 100644
--- a/epan/dissectors/packet-mbtcp.c
+++ b/epan/dissectors/packet-mbtcp.c
@@ -220,7 +220,7 @@ classify_mbrtu_packet(packet_info *pinfo, tvbuff_t *tvb)
/* Dig into these a little deeper to try to guess the message type */
if (!pinfo->srcport) {
/* If length is 8, this is either a query or very short response */
- if (tvb_length(tvb) == 8) {
+ if (tvb_captured_length(tvb) == 8) {
/* Only possible to get a response message of 8 bytes with Discrete or Coils */
if ((tvb_get_guint8(tvb, 1) == READ_COILS) || (tvb_get_guint8(tvb, 1) == READ_DISCRETE_INPUTS)) {
/* If this is, in fact, a response then the data byte count will be 3 */
@@ -494,12 +494,12 @@ dissect_mbtcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
p_add_proto_data(wmem_file_scope(), pinfo, proto_modbus, 0, request_info);
/* Continue with dissection of Modbus data payload following Modbus/TCP frame */
- if( tvb_length_remaining(tvb, offset) > 0 )
+ if( tvb_captured_length_remaining(tvb, offset) > 0 )
call_dissector(modbus_handle, next_tvb, pinfo, tree);
p_remove_proto_data(wmem_file_scope(), pinfo, proto_modbus, 0);
p_add_proto_data(wmem_file_scope(), pinfo, proto_modbus, 0, p_save_proto_data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Code to dissect Modbus RTU over TCP packets */
@@ -523,7 +523,7 @@ dissect_mbrtu_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Modbus RTU");
col_clear(pinfo->cinfo, COL_INFO);
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
unit_id = tvb_get_guint8(tvb, 0);
function_code = tvb_get_guint8(tvb, 1) & 0x7F;
@@ -636,12 +636,12 @@ dissect_mbrtu_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
p_add_proto_data(wmem_file_scope(), pinfo, proto_modbus, 0, request_info);
/* Continue with dissection of Modbus data payload following Modbus RTU frame */
- if( tvb_length_remaining(tvb, offset) > 0 )
+ if( tvb_captured_length_remaining(tvb, offset) > 0 )
call_dissector(modbus_handle, next_tvb, pinfo, tree);
p_remove_proto_data(wmem_file_scope(), pinfo, proto_modbus, 0);
p_add_proto_data(wmem_file_scope(), pinfo, proto_modbus, 0, p_save_proto_data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -669,7 +669,7 @@ get_mbrtu_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_)
{
/* Modbus/TCP frames include a "length" word in each message; Modbus RTU over TCP does not, so don't attempt to get one */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -696,7 +696,7 @@ dissect_mbtcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
tcp_dissect_pdus(tvb, pinfo, tree, mbtcp_desegment, 6,
get_mbtcp_pdu_len, dissect_mbtcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Code to dissect Modbus RTU over TCP messages */
@@ -717,7 +717,7 @@ dissect_mbrtu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
tcp_dissect_pdus(tvb, pinfo, tree, mbrtu_desegment, 6,
get_mbrtu_pdu_len, dissect_mbrtu_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -852,7 +852,7 @@ dissect_modbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
guint16 diagnostic_code;
modbus_request_info_t *request_info;
- len = tvb_length_remaining(tvb, 0);
+ len = tvb_captured_length_remaining(tvb, 0);
/* If the packet is zero-length, we should not attempt to dissect any further */
if (len == 0)
@@ -1368,7 +1368,7 @@ dissect_modbus(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-mdshdr.c b/epan/dissectors/packet-mdshdr.c
index 7c57f915cc..37cfadad8e 100644
--- a/epan/dissectors/packet-mdshdr.c
+++ b/epan/dissectors/packet-mdshdr.c
@@ -153,7 +153,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pktlen = tvb_get_ntohs(tvb, offset+MDSHDR_PKTLEN_OFFSET) & 0x1FFF;
/* The Mdshdr trailer is at the end of the frame */
- if ((tvb_length(tvb) >= (MDSHDR_HEADER_SIZE + pktlen))
+ if ((tvb_captured_length(tvb) >= (MDSHDR_HEADER_SIZE + pktlen))
/* Avoid header/trailer overlap if something wrong */
&& (pktlen >= MDSHDR_TRAILER_SIZE)) {
trailer_start = MDSHDR_HEADER_SIZE + pktlen - MDSHDR_TRAILER_SIZE;
@@ -213,7 +213,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
PROTO_ITEM_SET_HIDDEN(hidden_item);
/* Add Mdshdr Trailer part */
- if (tvb_length(tvb) >= MDSHDR_HEADER_SIZE + pktlen
+ if (tvb_captured_length(tvb) >= MDSHDR_HEADER_SIZE + pktlen
&& 0 != trailer_start) {
ti_trlr = proto_tree_add_text(mdshdr_tree_main, tvb, trailer_start,
MDSHDR_TRAILER_SIZE,
@@ -230,7 +230,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- if (tvb_length(tvb) >= MDSHDR_HEADER_SIZE + pktlen
+ if (tvb_captured_length(tvb) >= MDSHDR_HEADER_SIZE + pktlen
&& 0 != pktlen /*if something wrong*/) {
next_tvb = tvb_new_subset_length(tvb, MDSHDR_HEADER_SIZE, pktlen);
/* XXX what to do with the rest of this frame? --ArtemTamazov */
diff --git a/epan/dissectors/packet-media.c b/epan/dissectors/packet-media.c
index 01a295a1e1..e944cbcfd8 100644
--- a/epan/dissectors/packet-media.c
+++ b/epan/dissectors/packet-media.c
@@ -49,14 +49,14 @@ dissect_media(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree, void* data)
heur_dtbl_entry_t *hdtbl_entry;
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, data)) {
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Add media type to the INFO column if it is visible */
col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", (pinfo->match_string) ? pinfo->match_string : "");
if (tree) {
- if ( (bytes = tvb_length(tvb)) > 0 )
+ if ( (bytes = tvb_captured_length(tvb)) > 0 )
{
ti = proto_tree_add_item(tree, proto_media, tvb, 0, -1, ENC_NA);
media_tree = proto_item_add_subtree(ti, ett_media);
@@ -77,7 +77,7 @@ dissect_media(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree, void* data)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c
index 34ffbe0f50..f7fa3512cb 100644
--- a/epan/dissectors/packet-megaco.c
+++ b/epan/dissectors/packet-megaco.c
@@ -349,7 +349,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
top_tree=tree;
/* Initialize variables */
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
megaco_tree = NULL;
ti = NULL;
tvb_offset = 0;
@@ -1425,7 +1425,7 @@ dissect_megaco_descriptors(tvbuff_t *tvb, proto_tree *megaco_tree_command_line,
gint tvb_current_offset,tvb_previous_offset,tokenlen;
gint tvb_RBRKT, tvb_LBRKT;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
tvb_LBRKT = megaco_tvb_skip_wsp(tvb, tvb_descriptors_start_offset +1);
@@ -3234,7 +3234,7 @@ static void tvb_raw_text_add(tvbuff_t *tvb, proto_tree *tree){
gint tvb_linebegin,tvb_lineend,tvb_len,linelen;
tvb_linebegin = 0;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
proto_tree_add_text(tree, tvb, 0, -1,"-------------- (RAW text output) ---------------");
@@ -3262,7 +3262,7 @@ static gint megaco_tvb_skip_wsp(tvbuff_t* tvb, gint offset ){
gint counter = offset;
gint end,tvb_len;
guint8 tempchar;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
end = tvb_len;
for(counter = offset; counter < end &&
diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c
index b58880654c..f4e57e0cf0 100644
--- a/epan/dissectors/packet-memcache.c
+++ b/epan/dissectors/packet-memcache.c
@@ -607,7 +607,7 @@ dissect_memcache (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
val_to_str_const (status, status_vals, "Unknown"), status);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Obtain the content length by peeping into the header.
@@ -673,7 +673,7 @@ desegment_pdus (tvbuff_t *tvb, packet_info *pinfo, const int offset,
/* data_offset has been set to start of the data block. */
if (!tvb_bytes_exist (tvb, data_offset, content_length)) {
- length_remaining = tvb_length_remaining (tvb, data_offset);
+ length_remaining = tvb_captured_length_remaining (tvb, data_offset);
reported_length_remaining = tvb_reported_length_remaining (tvb, data_offset);
if (length_remaining < reported_length_remaining) {
@@ -735,7 +735,7 @@ memcache_req_resp_hdrs_do_reassembly (
return FALSE;
}
- length_remaining = tvb_length_remaining (tvb, next_offset);
+ length_remaining = tvb_captured_length_remaining (tvb, next_offset);
/* Request one more byte if we cannot find a
* header (i.e. a line end).
@@ -898,7 +898,7 @@ dissect_memcache_message (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t
* value and the amount of data remaining in the frame.
*
*/
- datalen = tvb_length_remaining (tvb, offset);
+ datalen = tvb_captured_length_remaining (tvb, offset);
if (datalen > 0) {
/*
* We've processed "datalen" bytes worth of data
@@ -928,7 +928,7 @@ content_data_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
*/
if (tvb_reported_length_remaining (tvb, offset) != 0) {
/* bytes actually remaining in this tvbuff. */
- datalen = tvb_length_remaining (tvb, offset);
+ datalen = tvb_captured_length_remaining (tvb, offset);
if (content_length >= 0) {
if (datalen >= (content_length + 2)) { /* also consider \r\n*/
datalen = content_length;
@@ -1917,7 +1917,7 @@ dissect_memcache_tcp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
dissect_memcache_text (tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Dissect udp packets based on the type of protocol (text/binary) */
@@ -1935,7 +1935,7 @@ dissect_memcache_udp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
dissect_memcache_message (tvb, 0, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Registration functions; register memcache protocol,
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index d1bbc741d3..6509410eee 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -339,7 +339,7 @@ static int dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
/* Initialize variables */
tvb_sectionend = 0;
tvb_sectionbegin = tvb_sectionend;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
num_messages = 0;
mgcp_tree = NULL;
ti = NULL;
@@ -448,7 +448,7 @@ static int dissect_tpkt_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
* Dissect ASCII TPKT header
*/
dissect_asciitpkt(tvb, pinfo, tree, mgcp_handle);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
return offset;
@@ -494,7 +494,7 @@ static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
mi->hasDigitMap = FALSE;
/* Initialize variables */
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
/*
* Check to see whether we're really dealing with MGCP by looking
@@ -560,7 +560,7 @@ static void mgcp_raw_text_add(tvbuff_t *tvb, proto_tree *tree)
gint tvb_linebegin,tvb_lineend,tvb_len,linelen;
tvb_linebegin = 0;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
do
{
@@ -1400,7 +1400,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
static address null_address = { AT_NONE, -1, 0, NULL };
tvb_previous_offset = 0;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
tvb_current_offset = tvb_previous_offset;
mi->is_duplicate = FALSE;
mi->request_available = FALSE;
@@ -1411,7 +1411,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
do
{
- tvb_current_len = tvb_length_remaining(tvb,tvb_previous_offset);
+ tvb_current_len = tvb_captured_length_remaining(tvb,tvb_previous_offset);
tvb_current_offset = tvb_find_guint8(tvb, tvb_previous_offset, tvb_current_len, ' ');
if (tvb_current_offset == -1)
{
@@ -1773,7 +1773,7 @@ static void dissect_mgcp_params(tvbuff_t *tvb, proto_tree *tree)
gint tvb_tokenbegin;
proto_tree *mgcp_param_ti, *mgcp_param_tree;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
tvb_linebegin = 0;
tvb_lineend = tvb_linebegin;
@@ -2141,7 +2141,7 @@ static gint tvb_find_null_line(tvbuff_t* tvb, gint offset, gint len, gint* next_
}
else
{
- tvb_current_len = tvb_length_remaining(tvb,offset);
+ tvb_current_len = tvb_captured_length_remaining(tvb,offset);
}
maxoffset = (tvb_current_len - 1) + offset;
@@ -2151,7 +2151,7 @@ static gint tvb_find_null_line(tvbuff_t* tvb, gint offset, gint len, gint* next_
do
{
tvb_linebegin = tvb_lineend;
- tvb_current_len = tvb_length_remaining(tvb,tvb_linebegin);
+ tvb_current_len = tvb_captured_length_remaining(tvb,tvb_linebegin);
tvb_find_line_end(tvb, tvb_linebegin, tvb_current_len, &tvb_lineend,FALSE);
tempchar = tvb_get_guint8(tvb,tvb_linebegin);
} while (tempchar != '\r' && tempchar != '\n' && tvb_lineend <= maxoffset);
@@ -2165,7 +2165,7 @@ static gint tvb_find_null_line(tvbuff_t* tvb, gint offset, gint len, gint* next_
}
else
{
- tvb_current_len = tvb_length_remaining(tvb,offset);
+ tvb_current_len = tvb_captured_length_remaining(tvb,offset);
}
return tvb_current_len;
@@ -2197,7 +2197,7 @@ static gint tvb_find_dot_line(tvbuff_t* tvb, gint offset, gint len, gint* next_o
gint tvb_current_offset, tvb_current_len, maxoffset,tvb_len;
guint8 tempchar;
tvb_current_len = len;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
if (len == -1)
{
diff --git a/epan/dissectors/packet-mih.c b/epan/dissectors/packet-mih.c
index def5217599..f67072fe1f 100644
--- a/epan/dissectors/packet-mih.c
+++ b/epan/dissectors/packet-mih.c
@@ -1625,7 +1625,7 @@ static void dissect_mih_tlv(tvbuff_t *tvb,int offset, proto_tree *tlv_tree, guin
proto_tree_add_item(tlv_tree, hf_mihf_id, tvb, offset+1, mihf_id_len, ENC_ASCII|ENC_NA);
else
{
- if(mihf_id_len<tvb_length_remaining(tvb,0) && (mihf_id_len==12 || mihf_id_len==64 || mihf_id_len==128))
+ if(mihf_id_len<tvb_captured_length_remaining(tvb,0) && (mihf_id_len==12 || mihf_id_len==64 || mihf_id_len==128))
{
tvb_mihf_id = tvb_new_composite();
for(i=0; i < mihf_id_len/2; i++)
diff --git a/epan/dissectors/packet-mikey.c b/epan/dissectors/packet-mikey.c
index 8062e22fe4..df6b260701 100644
--- a/epan/dissectors/packet-mikey.c
+++ b/epan/dissectors/packet-mikey.c
@@ -1424,7 +1424,7 @@ dissect_mikey(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
val_to_str_ext_const(mikey->type, &data_type_vals_ext, "Unknown"));
/* 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-mim.c b/epan/dissectors/packet-mim.c
index 3aff757720..2248196ba0 100644
--- a/epan/dissectors/packet-mim.c
+++ b/epan/dissectors/packet-mim.c
@@ -283,7 +283,7 @@ dissect_fp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
next_tvb = tvb_new_subset_remaining( tvb, FP_HEADER_SIZE) ;
call_dissector( eth_dissector, next_tvb, pinfo, tree ) ;
- return tvb_length( tvb ) ;
+ return tvb_captured_length( tvb ) ;
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-mint.c b/epan/dissectors/packet-mint.c
index 469d3fddd6..4559132b1a 100644
--- a/epan/dissectors/packet-mint.c
+++ b/epan/dissectors/packet-mint.c
@@ -550,7 +550,7 @@ static int
dissect_mint_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint32 offset = 0;
- guint32 packet_length = tvb_length_remaining(tvb, 0);
+ guint32 packet_length = tvb_captured_length_remaining(tvb, 0);
offset += dissect_mint_common(tvb, pinfo, tree, 0, packet_length,
PORT_MINT_CONTROL_TUNNEL);
@@ -562,7 +562,7 @@ static int
dissect_mint_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint32 offset = 0;
- guint32 packet_length = tvb_length_remaining(tvb, 0);
+ guint32 packet_length = tvb_captured_length_remaining(tvb, 0);
offset += dissect_mint_common(tvb, pinfo, tree, 0, packet_length,
PORT_MINT_DATA_TUNNEL);
@@ -600,7 +600,7 @@ test_mint_control(tvbuff_t *tvb _U_)
{
#if 0
/* Minimum of 8 bytes, first byte (version) has value of 3 */
- if ( tvb_length(tvb) < 8
+ if ( tvb_captured_length(tvb) < 8
|| tvb_get_guint8(tvb, 0) != 3
/* || tvb_get_guint8(tvb, 2) != 0
|| tvb_get_ntohs(tvb, 6) > tvb_reported_length(tvb) */
@@ -616,7 +616,7 @@ test_mint_data(tvbuff_t *tvb _U_)
{
#if 0
/* Minimum of 8 bytes, first byte (version) has value of 3 */
- if ( tvb_length(tvb) < 8
+ if ( tvb_captured_length(tvb) < 8
|| tvb_get_guint8(tvb, 0) != 3
/* || tvb_get_guint8(tvb, 2) != 0
|| tvb_get_ntohs(tvb, 6) > tvb_reported_length(tvb) */
@@ -632,7 +632,7 @@ test_mint_eth(tvbuff_t *tvb _U_)
{
#if 0
/* Minimum of 8 bytes, first byte (version) has value of 3 */
- if ( tvb_length(tvb) < 8
+ if ( tvb_captured_length(tvb) < 8
|| tvb_get_guint8(tvb, 0) != 3
/* || tvb_get_guint8(tvb, 2) != 0
|| tvb_get_ntohs(tvb, 6) > tvb_reported_length(tvb) */
diff --git a/epan/dissectors/packet-miop.c b/epan/dissectors/packet-miop.c
index 093c9cef5f..a4ad30883e 100644
--- a/epan/dissectors/packet-miop.c
+++ b/epan/dissectors/packet-miop.c
@@ -96,7 +96,7 @@ dissect_miop_heur (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void
/* check magic number and version */
- tot_len = tvb_length(tvb);
+ tot_len = tvb_captured_length(tvb);
if (tot_len < MIOP_HEADER_SIZE) /* tot_len < 16 */
{
diff --git a/epan/dissectors/packet-mms.c b/epan/dissectors/packet-mms.c
index 22070c6211..f35596cde2 100644
--- a/epan/dissectors/packet-mms.c
+++ b/epan/dissectors/packet-mms.c
@@ -1840,7 +1840,7 @@ dissect_mms_TimeOfDay(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _
gchar * ptime;
nstime_t ts;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if(len == 4)
{
@@ -1921,7 +1921,7 @@ dissect_mms_UtcTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_
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-mndp.c b/epan/dissectors/packet-mndp.c
index 4dd58d94a7..b52e732345 100644
--- a/epan/dissectors/packet-mndp.c
+++ b/epan/dissectors/packet-mndp.c
@@ -226,7 +226,7 @@ dissect_mndp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
- packet_length = tvb_length(tvb);
+ packet_length = tvb_captured_length(tvb);
/* Header dissection */
ti = proto_tree_add_item(tree, proto_mndp, tvb, offset, -1,
@@ -252,7 +252,7 @@ static gboolean
test_mndp(tvbuff_t *tvb)
{
/* Minimum of 8 bytes, 4 Bytes header + 1 TLV-header */
- if ( tvb_length(tvb) < 8
+ if ( tvb_captured_length(tvb) < 8
|| tvb_get_guint8(tvb, 4) != 0
|| tvb_get_guint8(tvb, 6) != 0
) {
diff --git a/epan/dissectors/packet-mojito.c b/epan/dissectors/packet-mojito.c
index 3af8cd9b03..9d01c6d1c9 100644
--- a/epan/dissectors/packet-mojito.c
+++ b/epan/dissectors/packet-mojito.c
@@ -701,7 +701,7 @@ dissect_mojito(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean dissect_mojito_heuristic (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
@@ -710,9 +710,9 @@ static gboolean dissect_mojito_heuristic (tvbuff_t *tvb, packet_info *pinfo, pro
Test the overall length to make sure it's at least 61 bytes (the header)
Test to make sure that it's of type 44 (mojito)
Test to make sure that the length field is there and correct
- (tvb_get_letohl(tvb, 20) + 23) == tvb_length(tvb)
+ (tvb_get_letohl(tvb, 20) + 23) == tvb_captured_length(tvb)
*/
- if ((tvb_length(tvb) >= 60) &&
+ if ((tvb_captured_length(tvb) >= 60) &&
(tvb_get_guint8(tvb, 16) == 68) &&
((tvb_get_letohl(tvb, 19) + 23) == tvb_reported_length(tvb)))
{
diff --git a/epan/dissectors/packet-moldudp.c b/epan/dissectors/packet-moldudp.c
index 70499c07ca..43ed8bcddf 100644
--- a/epan/dissectors/packet-moldudp.c
+++ b/epan/dissectors/packet-moldudp.c
@@ -181,7 +181,7 @@ dissect_moldudp(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-moldudp64.c b/epan/dissectors/packet-moldudp64.c
index 2d8f7c9365..6f4d2edd6b 100644
--- a/epan/dissectors/packet-moldudp64.c
+++ b/epan/dissectors/packet-moldudp64.c
@@ -74,7 +74,7 @@ dissect_moldudp64_msgblk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint16 msglen, real_msglen, whole_len;
gint remaining;
- if (tvb_length_remaining(tvb, offset) < MOLDUDP64_MSGLEN_LEN)
+ if (tvb_captured_length_remaining(tvb, offset) < MOLDUDP64_MSGLEN_LEN)
return 0;
msglen = tvb_get_ntohs(tvb, offset);
@@ -195,7 +195,7 @@ dissect_moldudp64(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
}
/* 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-mongo.c b/epan/dissectors/packet-mongo.c
index 478546f683..1438afa3b3 100644
--- a/epan/dissectors/packet-mongo.c
+++ b/epan/dissectors/packet-mongo.c
@@ -646,7 +646,7 @@ dissect_mongo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
expert_add_info(pinfo, ti, &ei_mongo_unknown);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
get_mongo_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
@@ -665,7 +665,7 @@ static int
dissect_mongo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, 1, 4, get_mongo_pdu_len, dissect_mongo_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c
index 0812737591..a3b227708f 100644
--- a/epan/dissectors/packet-mp2t.c
+++ b/epan/dissectors/packet-mp2t.c
@@ -461,7 +461,7 @@ mp2t_get_packet_length(tvbuff_t *tvb, guint offset, packet_info *pinfo,
gint pkt_len = 0;
guint remaining_len;
- remaining_len = tvb_length_remaining(tvb, offset);
+ remaining_len = tvb_captured_length_remaining(tvb, offset);
frag = fragment_get(&mp2t_reassembly_table, pinfo, frag_id, NULL);
if (frag)
frag = frag->next;
@@ -1218,7 +1218,7 @@ heur_dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
gint length;
guint offset = 0;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length == 0) {
/* Nothing to check for */
return FALSE;
diff --git a/epan/dissectors/packet-mp4ves.c b/epan/dissectors/packet-mp4ves.c
index 3ea5d00c80..3fe8097a5f 100644
--- a/epan/dissectors/packet-mp4ves.c
+++ b/epan/dissectors/packet-mp4ves.c
@@ -594,7 +594,7 @@ dissect_mp4ves_VisualObject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
bit_offset+=24;
proto_tree_add_bits_item(tree, hf_mp4ves_start_code, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
bit_offset+= 8;
- if(tvb_length_remaining(tvb,(bit_offset>>3))<=0){
+ if(tvb_captured_length_remaining(tvb,(bit_offset>>3))<=0){
item = proto_tree_add_text(tree, tvb, 0, -1, "Config string too short");
PROTO_ITEM_SET_GENERATED(item);
return -1;
@@ -742,7 +742,7 @@ dissect_mp4ves(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
- if (tvb_length(tvb)< 4){
+ if (tvb_captured_length(tvb)< 4){
/* To short to be a start code */
proto_tree_add_text(mp4ves_tree, tvb, bit_offset>>3, -1, "Data");
return;
@@ -842,7 +842,7 @@ dissect_mp4ves_par_decoderConfigurationInformation(tvbuff_t *tvb, packet_info *p
dissect_mp4ves_config(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
typedef struct _mp4ves_capability_t {
@@ -893,7 +893,7 @@ dissect_mp4ves_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree, voi
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-mpls-echo.c b/epan/dissectors/packet-mpls-echo.c
index 6e26cbd199..1c4d7435ee 100644
--- a/epan/dissectors/packet-mpls-echo.c
+++ b/epan/dissectors/packet-mpls-echo.c
@@ -1703,7 +1703,7 @@ dissect_mpls_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
guint8 msgtype;
/* If version != 1 we assume it's not an mpls ping packet */
- if (tvb_length(tvb) < 5) {
+ if (tvb_captured_length(tvb) < 5) {
return 0; /* Not enough information to tell version and message type. */
}
if (tvb_get_ntohs(tvb, 0) != 1) {
@@ -1802,7 +1802,7 @@ dissect_mpls_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
rem -= len;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-mq-pcf.c b/epan/dissectors/packet-mq-pcf.c
index d3e1d811df..e775cefaf8 100644
--- a/epan/dissectors/packet-mq-pcf.c
+++ b/epan/dissectors/packet-mq-pcf.c
@@ -188,7 +188,7 @@ static void dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq
guint32 xOfs = offset;
uCnt = 0;
- while (tvb_length_remaining(tvb, xOfs) >= 16)
+ while (tvb_captured_length_remaining(tvb, xOfs) >= 16)
{
uLen = tvb_get_guint32_endian(tvb, xOfs + 4, bLittleEndian);
if (uLen < 16)
@@ -562,7 +562,7 @@ static void dissect_mqpcf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, m
bLittleEndian = ((p_mq_parm->mq_cur_ccsid.encod & MQ_MQENC_INTEGER_MASK) == MQ_MQENC_INTEGER_REVERSED) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN;
- if (tvb_length(tvb) >= 36)
+ if (tvb_captured_length(tvb) >= 36)
{
gint iSizeMQCFH = 36;
guint32 iCommand = tvb_get_guint32_endian(tvb, offset + 12, bLittleEndian);
@@ -628,7 +628,7 @@ static void dissect_mqpcf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, m
static gboolean dissect_mqpcf_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if (data && tvb_length(tvb) >= 36)
+ if (data && tvb_captured_length(tvb) >= 36)
{
mq_parm_t *p_mq_parm = (mq_parm_t *)data;
if (strncmp((const char*)p_mq_parm->mq_format, MQ_MQFMT_ADMIN, 8) == 0
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index 3359dbae68..8b5e516acb 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -1893,7 +1893,7 @@ static gint dissect_mq_pmr(tvbuff_t *tvb, proto_tree *tree, gint offset, gint iN
if (offsetPMR != 0 && iSizePMR1 != 0)
{
iSizePMR = iNbrRecords * iSizePMR1;
- if (tvb_length_remaining(tvb, offset) >= iSizePMR)
+ if (tvb_captured_length_remaining(tvb, offset) >= iSizePMR)
{
if (tree)
{
@@ -1941,7 +1941,7 @@ static gint dissect_mq_or(tvbuff_t *tvb, proto_tree *tree, gint offset, gint iNb
if (offsetOR != 0)
{
iSizeOR = iNbrRecords * 96;
- if (tvb_length_remaining(tvb, offset) >= iSizeOR)
+ if (tvb_captured_length_remaining(tvb, offset) >= iSizeOR)
{
if (tree)
{
@@ -1967,7 +1967,7 @@ static gint dissect_mq_rr(tvbuff_t *tvb, proto_tree *tree, gint offset, gint iNb
if (offsetRR != 0)
{
iSizeRR = iNbrRecords * 8;
- if (tvb_length_remaining(tvb, offset) >= iSizeRR)
+ if (tvb_captured_length_remaining(tvb, offset) >= iSizeRR)
{
if (tree)
{
@@ -1991,7 +1991,7 @@ static gint dissect_mq_gmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
gint iSize = 0;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
if (p_mq_parm->mq_strucID == MQ_STRUCTID_GMO || p_mq_parm->mq_strucID == MQ_STRUCTID_GMO_EBCDIC)
{
guint32 iVersion = 0;
@@ -2004,7 +2004,7 @@ static gint dissect_mq_gmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case 3: iSize = 100; break;
}
- if (iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
+ if (iSize != 0 && tvb_captured_length_remaining(tvb, offset) >= iSize)
{
guint8 *sQueue;
sQueue = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 24, 48, p_mq_parm->mq_str_enc);
@@ -2057,7 +2057,7 @@ static gint dissect_mq_pmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
gint iSize = 0;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
if (p_mq_parm->mq_strucID == MQ_STRUCTID_PMO || p_mq_parm->mq_strucID == MQ_STRUCTID_PMO_EBCDIC)
{
guint32 iVersion = 0;
@@ -2069,7 +2069,7 @@ static gint dissect_mq_pmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case 2: iSize = 152;break;
}
- if (iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
+ if (iSize != 0 && tvb_captured_length_remaining(tvb, offset) >= iSize)
{
guint8 *sQueue;
@@ -2138,7 +2138,7 @@ static gint dissect_mq_od(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
{
gint iSize = 0;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
if (p_mq_parm->mq_strucID == MQ_STRUCTID_OD || p_mq_parm->mq_strucID == MQ_STRUCTID_OD_EBCDIC)
{
/* The OD struct can be present in several messages at different levels */
@@ -2153,7 +2153,7 @@ static gint dissect_mq_od(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
case 4: iSize = 336+3*20+4; break;
}
- if (iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
+ if (iSize != 0 && tvb_captured_length_remaining(tvb, offset) >= iSize)
{
gint iNbrRecords = 0;
guint8 *sObj;
@@ -2231,7 +2231,7 @@ static gint dissect_mq_od(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
static gint dissect_mq_xid(tvbuff_t *tvb, proto_tree *tree, mq_parm_t *p_mq_parm, gint offset)
{
gint iSizeXid = 0;
- if (tvb_length_remaining(tvb, offset) >= 6)
+ if (tvb_captured_length_remaining(tvb, offset) >= 6)
{
guint8 iXidLength = 0;
guint8 iBqLength = 0;
@@ -2240,7 +2240,7 @@ static gint dissect_mq_xid(tvbuff_t *tvb, proto_tree *tree, mq_parm_t *p_mq_parm
iBqLength = tvb_get_guint8(tvb, offset + 5);
iSizeXid = 6 + iXidLength + iBqLength;
- if (tvb_length_remaining(tvb, offset) >= iSizeXid)
+ if (tvb_captured_length_remaining(tvb, offset) >= iSizeXid)
{
if (tree)
{
@@ -2257,7 +2257,7 @@ static gint dissect_mq_xid(tvbuff_t *tvb, proto_tree *tree, mq_parm_t *p_mq_parm
proto_tree_add_item(mq_tree, hf_mq_xa_xid_brq , tvb, offset + 6 + iXidLength, iBqLength, ENC_NA);
}
iSizeXid += (4 - (iSizeXid % 4)) % 4; /* Pad for alignment with 4 byte word boundary */
- if (tvb_length_remaining(tvb, offset) < iSizeXid)
+ if (tvb_captured_length_remaining(tvb, offset) < iSizeXid)
iSizeXid = 0;
}
else iSizeXid = 0;
@@ -2306,7 +2306,7 @@ static gint dissect_mq_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mqroot_
else
iSize = 208;
- if (iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
+ if (iSize != 0 && tvb_captured_length_remaining(tvb, offset) >= iSize)
{
guint8 *sChannel;
sChannel = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 24, 20, p_mq_parm->mq_str_enc);
@@ -2389,7 +2389,7 @@ static gint dissect_mq_md(tvbuff_t *tvb, proto_tree *tree, gint offset, mq_parm_
{
gint iSize = 0;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
if (p_mq_parm->mq_strucID == MQ_STRUCTID_MD || p_mq_parm->mq_strucID == MQ_STRUCTID_MD_EBCDIC)
{
guint32 iVersion = 0;
@@ -2401,7 +2401,7 @@ static gint dissect_mq_md(tvbuff_t *tvb, proto_tree *tree, gint offset, mq_parm_
case 2: iSize = 364; break;
}
- if (bDecode && iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
+ if (bDecode && iSize != 0 && tvb_captured_length_remaining(tvb, offset) >= iSize)
{
p_mq_parm->iOfsEnc = offset + 24;
p_mq_parm->iOfsCcs = offset + 28;
@@ -2456,11 +2456,11 @@ static gint dissect_mq_fopa(tvbuff_t *tvb, proto_tree *tree, gint offset, mq_par
{
gint iSize = 0;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
if (p_mq_parm->mq_strucID == MQ_STRUCTID_FOPA || p_mq_parm->mq_strucID == MQ_STRUCTID_FOPA_EBCDIC)
{
iSize = tvb_get_guint32_endian(tvb, offset+8, p_mq_parm->mq_int_enc);
- if (iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
+ if (iSize != 0 && tvb_captured_length_remaining(tvb, offset) >= iSize)
{
if (tree)
{
@@ -2507,12 +2507,12 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
p_mq_parm->iOfsEnc = 0;
p_mq_parm->iOfsFmt = 0;
p_mq_parm->iOfsCcs = 0;
- if (tvb_length(tvb) >= 4)
+ if (tvb_captured_length(tvb) >= 4)
{
p_mq_parm->mq_strucID = tvb_get_ntohl(tvb, offset);
if (((p_mq_parm->mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx ||
(p_mq_parm->mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC)
- && tvb_length_remaining(tvb, offset) >= 28)
+ && tvb_captured_length_remaining(tvb, offset) >= 28)
{
proto_tree *mq_tree = NULL;
proto_tree *mqroot_tree = NULL;
@@ -2532,7 +2532,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (p_mq_parm->mq_strucID == MQ_STRUCTID_TSHM || p_mq_parm->mq_strucID == MQ_STRUCTID_TSHM_EBCDIC)
{
- if (tvb_length_remaining(tvb, offset) < 36)
+ if (tvb_captured_length_remaining(tvb, offset) < 36)
return;
iSizeMPF += 8;
iSizeTSH = 36;
@@ -2606,14 +2606,14 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += iSizeTSH;
/* Now dissect the embedded structures */
- if (tvb_length_remaining(tvb, offset) >= 4)
+ if (tvb_captured_length_remaining(tvb, offset) >= 4)
{
p_mq_parm->mq_strucID = tvb_get_ntohl(tvb, offset);
if (((p_mq_parm->mq_ctlf1 & MQ_TCF_FIRST) != 0) || p_mq_parm->mq_opcode < 0x80)
{
/* First MQ segment (opcodes below 0x80 never span several TSH) */
gint iSizeAPI = 16;
- if (p_mq_parm->mq_opcode >= 0x80 && p_mq_parm->mq_opcode <= 0x9F && tvb_length_remaining(tvb, offset) >= 16)
+ if (p_mq_parm->mq_opcode >= 0x80 && p_mq_parm->mq_opcode <= 0x9F && tvb_captured_length_remaining(tvb, offset) >= 16)
{
guint32 iReturnCode = 0;
guint32 iHdl = 0;
@@ -2635,9 +2635,9 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_api_objecthdl, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
}
offset += iSizeAPI;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
- if ((p_mq_parm->mq_strucID == MQ_STRUCTID_MSH || p_mq_parm->mq_strucID == MQ_STRUCTID_MSH_EBCDIC) && tvb_length_remaining(tvb, offset) >= 20)
+ if ((p_mq_parm->mq_strucID == MQ_STRUCTID_MSH || p_mq_parm->mq_strucID == MQ_STRUCTID_MSH_EBCDIC) && tvb_captured_length_remaining(tvb, offset) >= 20)
{
gint iSize = 20;
iSizePayload = tvb_get_guint32_endian(tvb, offset + 16, p_mq_parm->mq_int_enc);
@@ -2655,7 +2655,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
offset += iSize;
}
- else if (p_mq_parm->mq_opcode == MQ_TST_CONAUTH_INFO && tvb_length_remaining(tvb, offset) >= 20)
+ else if (p_mq_parm->mq_opcode == MQ_TST_CONAUTH_INFO && tvb_captured_length_remaining(tvb, offset) >= 20)
{
gint iSize = 24;
gint iUsr = 0;
@@ -2682,9 +2682,9 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_caut_psw, tvb, offset + 24 + iUsr, iPsw, p_mq_parm->mq_str_enc);
}
offset += iSize + iUsr + iPsw;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
- else if (p_mq_parm->mq_opcode == MQ_TST_SOCKET_ACTION && tvb_length_remaining(tvb, offset) >= 20)
+ else if (p_mq_parm->mq_opcode == MQ_TST_SOCKET_ACTION && tvb_captured_length_remaining(tvb, offset) >= 20)
{
gint iSize = 20;
if (tree)
@@ -2699,9 +2699,9 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_socket_parm2, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
}
offset += iSize;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
- else if (p_mq_parm->mq_opcode == MQ_TST_STATUS && tvb_length_remaining(tvb, offset) >= 8)
+ else if (p_mq_parm->mq_opcode == MQ_TST_STATUS && tvb_captured_length_remaining(tvb, offset) >= 8)
{
/* Some status are 28 bytes long and some are 36 bytes long */
gint iStatus = 0;
@@ -2710,7 +2710,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
iStatus = tvb_get_guint32_endian(tvb, offset + 4, p_mq_parm->mq_int_enc);
iStatusLength = tvb_get_guint32_endian(tvb, offset, p_mq_parm->mq_int_enc);
- if (tvb_length_remaining(tvb, offset) >= iStatusLength)
+ if (tvb_captured_length_remaining(tvb, offset) >= iStatusLength)
{
if (iStatus != 0)
col_append_fstr(pinfo->cinfo, COL_INFO, " Code=%s", val_to_str(iStatus, GET_VALSV(status), "Unknown (0x%08x)"));
@@ -2729,7 +2729,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += iStatusLength;
}
}
- else if (p_mq_parm->mq_opcode == MQ_TST_PING && tvb_length_remaining(tvb, offset) > 4)
+ else if (p_mq_parm->mq_opcode == MQ_TST_PING && tvb_captured_length_remaining(tvb, offset) > 4)
{
if (tree)
{
@@ -2739,9 +2739,9 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_ping_length, tvb, offset, 4, p_mq_parm->mq_int_enc);
proto_tree_add_item(mq_tree, hf_mq_ping_buffer, tvb, offset + 4, -1, ENC_NA);
}
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
- else if (p_mq_parm->mq_opcode == MQ_TST_RESET && tvb_length_remaining(tvb, offset) >= 8)
+ else if (p_mq_parm->mq_opcode == MQ_TST_RESET && tvb_captured_length_remaining(tvb, offset) >= 8)
{
if (tree)
{
@@ -2751,11 +2751,11 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_reset_length, tvb, offset, 4, p_mq_parm->mq_int_enc);
proto_tree_add_item(mq_tree, hf_mq_reset_seqnum, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
}
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
else if ((p_mq_parm->mq_opcode == MQ_TST_MQOPEN || p_mq_parm->mq_opcode == MQ_TST_MQCLOSE ||
p_mq_parm->mq_opcode == MQ_TST_MQOPEN_REPLY || p_mq_parm->mq_opcode == MQ_TST_MQCLOSE_REPLY)
- && tvb_length_remaining(tvb, offset) >= 4)
+ && tvb_captured_length_remaining(tvb, offset) >= 4)
{
offset += dissect_mq_od(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize);
if (tree)
@@ -2772,11 +2772,11 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
offset += 4;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
offset += dissect_mq_fopa(tvb, mqroot_tree, offset, p_mq_parm);
}
else if ((p_mq_parm->mq_opcode == MQ_TST_MQCONN || p_mq_parm->mq_opcode == MQ_TST_MQCONN_REPLY) &&
- tvb_length_remaining(tvb, offset) > 0)
+ tvb_captured_length_remaining(tvb, offset) > 0)
{
gint iSizeCONN = 0;
gint nofs;
@@ -2789,7 +2789,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (iSizeCONN != 112 && iSizeCONN != 120 && iSizeCONN != 260 && iSizeCONN != 332)
iSizeCONN = 0;
- if (iSizeCONN != 0 && tvb_length_remaining(tvb, offset) >= iSizeCONN)
+ if (iSizeCONN != 0 && tvb_captured_length_remaining(tvb, offset) >= iSizeCONN)
{
guint8 *sApplicationName;
guint8 *sQMgr;
@@ -2849,7 +2849,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += iSizeCONN;
}
}
- else if ((p_mq_parm->mq_opcode == MQ_TST_MQINQ || p_mq_parm->mq_opcode == MQ_TST_MQINQ_REPLY || p_mq_parm->mq_opcode == MQ_TST_MQSET) && tvb_length_remaining(tvb, offset) >= 12)
+ else if ((p_mq_parm->mq_opcode == MQ_TST_MQINQ || p_mq_parm->mq_opcode == MQ_TST_MQINQ_REPLY || p_mq_parm->mq_opcode == MQ_TST_MQSET) && tvb_captured_length_remaining(tvb, offset) >= 12)
{
/* The MQINQ/MQSET structure is special because it does not start with a structid */
gint iNbSelectors;
@@ -2872,7 +2872,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_inq_charlen, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
}
iOffsetINQ = 12;
- if (tvb_length_remaining(tvb, offset + iOffsetINQ) >= iNbSelectors * 4)
+ if (tvb_captured_length_remaining(tvb, offset + iOffsetINQ) >= iNbSelectors * 4)
{
if (tree)
{
@@ -2886,7 +2886,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
gint iSizeINQValues;
iSizeINQValues = iNbIntegers * 4 + iCharLen;
- if (tvb_length_remaining(tvb, offset + iOffsetINQ) >= iSizeINQValues)
+ if (tvb_captured_length_remaining(tvb, offset + iOffsetINQ) >= iSizeINQValues)
{
gint iInteger;
if (tree)
@@ -2907,7 +2907,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
- offset += tvb_length(tvb);
+ offset += tvb_captured_length(tvb);
}
else if (p_mq_parm->mq_opcode == MQ_TST_NOTIFICATION)
{
@@ -2928,7 +2928,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_notif_value, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
}
offset+=16;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
else if (p_mq_parm->mq_opcode == MQ_TST_REQUEST_MSGS)
{
@@ -3003,7 +3003,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
offset += (iFlags & 0x00000010) ? (64+xOfs) : 40;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
else if (p_mq_parm->mq_opcode == MQ_TST_ASYNC_MESSAGE)
{
@@ -3066,12 +3066,12 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
offset+=iHdrL;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
- iSizePayload = tvb_length_remaining(tvb, offset);
+ iSizePayload = tvb_captured_length_remaining(tvb, offset);
bPayload = (iSizePayload>0);
}
- else if ((p_mq_parm->mq_opcode == MQ_TST_SPI || p_mq_parm->mq_opcode == MQ_TST_SPI_REPLY) && tvb_length_remaining(tvb, offset) >= 12)
+ else if ((p_mq_parm->mq_opcode == MQ_TST_SPI || p_mq_parm->mq_opcode == MQ_TST_SPI_REPLY) && tvb_captured_length_remaining(tvb, offset) >= 12)
{
gint iOffsetSPI = 0;
guint32 iSpiVerb = 0;
@@ -3094,10 +3094,10 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
offset += 12;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
if (((p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxU ||
(p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxU_EBCDIC)
- && tvb_length_remaining(tvb, offset) >= 12)
+ && tvb_captured_length_remaining(tvb, offset) >= 12)
{
gint iSizeSPIMD = 0;
if (tree)
@@ -3112,14 +3112,14 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_spi_base_length , tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
}
offset += 12;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
if ((iSizeSPIMD = dissect_mq_md(tvb, mqroot_tree, offset, p_mq_parm, TRUE)) != 0)
{
offset += iSizeSPIMD;
offset += dissect_mq_gmo(tvb, pinfo, mqroot_tree, offset, p_mq_parm);
offset += dissect_mq_pmo(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize);
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
offset += dissect_mq_od(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize);
@@ -3128,7 +3128,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxO_EBCDIC ||
(p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxI ||
(p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxI_EBCDIC)
- && tvb_length_remaining(tvb, offset) >= 12)
+ && tvb_captured_length_remaining(tvb, offset) >= 12)
{
if (tree)
{
@@ -3144,7 +3144,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if ((p_mq_parm->mq_strucID == MQ_STRUCTID_SPQO || p_mq_parm->mq_strucID == MQ_STRUCTID_SPQO_EBCDIC)
- && tvb_length_remaining(tvb, offset) >= 16)
+ && tvb_captured_length_remaining(tvb, offset) >= 16)
{
if (tree)
{
@@ -3152,7 +3152,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mq_tree, hf_mq_spi_spqo_nbverb, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
iVerbNumber = tvb_get_guint32_endian(tvb, offset + 12, p_mq_parm->mq_int_enc);
- if (tvb_length_remaining(tvb, offset) >= iVerbNumber * 20 + 16)
+ if (tvb_captured_length_remaining(tvb, offset) >= iVerbNumber * 20 + 16)
{
gint iVerb = 0;
iOffsetSPI = offset + 16;
@@ -3170,7 +3170,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
else if ((p_mq_parm->mq_strucID == MQ_STRUCTID_SPAI || p_mq_parm->mq_strucID == MQ_STRUCTID_SPAI_EBCDIC)
- && tvb_length_remaining(tvb, offset) >= 136)
+ && tvb_captured_length_remaining(tvb, offset) >= 136)
{
if (tree)
{
@@ -3182,7 +3182,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 136;
}
else if ((p_mq_parm->mq_strucID == MQ_STRUCTID_SPGI || p_mq_parm->mq_strucID == MQ_STRUCTID_SPGI_EBCDIC)
- && tvb_length_remaining(tvb, offset) >= 24)
+ && tvb_captured_length_remaining(tvb, offset) >= 24)
{
if (tree)
{
@@ -3194,7 +3194,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else if ((p_mq_parm->mq_strucID == MQ_STRUCTID_SPGO || p_mq_parm->mq_strucID == MQ_STRUCTID_SPPI ||
p_mq_parm->mq_strucID == MQ_STRUCTID_SPGO_EBCDIC || p_mq_parm->mq_strucID == MQ_STRUCTID_SPPI_EBCDIC)
- && tvb_length_remaining(tvb, offset) >= 20)
+ && tvb_captured_length_remaining(tvb, offset) >= 20)
{
if (tree)
{
@@ -3209,11 +3209,11 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
offset += 12;
}
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
}
}
- else if ((p_mq_parm->mq_opcode >= 0xA0 && p_mq_parm->mq_opcode <= 0xB9) && tvb_length_remaining(tvb, offset) >= 16)
+ else if ((p_mq_parm->mq_opcode >= 0xA0 && p_mq_parm->mq_opcode <= 0xB9) && tvb_captured_length_remaining(tvb, offset) >= 16)
{
/* The XA structures are special because they do not start with a structid */
if (tree)
@@ -3239,11 +3239,11 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += iSizeXid;
}
else if ((p_mq_parm->mq_opcode == MQ_TST_XA_OPEN || p_mq_parm->mq_opcode == MQ_TST_XA_CLOSE)
- && tvb_length_remaining(tvb, offset) >= 1)
+ && tvb_captured_length_remaining(tvb, offset) >= 1)
{
guint8 iXAInfoLength = 0;
iXAInfoLength = tvb_get_guint8(tvb, offset);
- if (tvb_length_remaining(tvb, offset) >= iXAInfoLength + 1)
+ if (tvb_captured_length_remaining(tvb, offset) >= iXAInfoLength + 1)
{
if (tree)
{
@@ -3257,7 +3257,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1 + iXAInfoLength;
}
else if ((p_mq_parm->mq_opcode == MQ_TST_XA_RECOVER || p_mq_parm->mq_opcode == MQ_TST_XA_RECOVER_REPLY)
- && tvb_length_remaining(tvb, offset) >= 4)
+ && tvb_captured_length_remaining(tvb, offset) >= 4)
{
gint iNbXid = 0;
iNbXid = tvb_get_guint32_endian(tvb, offset, p_mq_parm->mq_int_enc);
@@ -3280,7 +3280,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
- if ((p_mq_parm->mq_strucID == MQ_STRUCTID_LPOO || p_mq_parm->mq_strucID == MQ_STRUCTID_LPOO_EBCDIC) && tvb_length_remaining(tvb, offset) >= 32)
+ if ((p_mq_parm->mq_strucID == MQ_STRUCTID_LPOO || p_mq_parm->mq_strucID == MQ_STRUCTID_LPOO_EBCDIC) && tvb_captured_length_remaining(tvb, offset) >= 32)
{
guint iVersion;
guint iXtraData = 0;
@@ -3292,7 +3292,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
iXtraData = tvb_get_guint32_endian(tvb, offset + 84, p_mq_parm->mq_int_enc);
}
- if (iSize != 0 && tvb_length_remaining(tvb, offset) >= iSize)
+ if (iSize != 0 && tvb_captured_length_remaining(tvb, offset) >= iSize)
{
if (tree)
{
@@ -3316,7 +3316,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
offset += iSize;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
if (iXtraData>0)
{
if (p_mq_parm->mq_opcode == MQ_TST_SPI_REPLY)
@@ -3328,12 +3328,12 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
- if ((p_mq_parm->mq_strucID == MQ_STRUCTID_ID || p_mq_parm->mq_strucID == MQ_STRUCTID_ID_EBCDIC) && tvb_length_remaining(tvb, offset) >= 5)
+ if ((p_mq_parm->mq_strucID == MQ_STRUCTID_ID || p_mq_parm->mq_strucID == MQ_STRUCTID_ID_EBCDIC) && tvb_captured_length_remaining(tvb, offset) >= 5)
{
offset += dissect_mq_id(tvb, pinfo, mqroot_tree, offset, p_mq_parm);
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
- if ((p_mq_parm->mq_strucID == MQ_STRUCTID_UID || p_mq_parm->mq_strucID == MQ_STRUCTID_UID_EBCDIC) && tvb_length_remaining(tvb, offset) > 0)
+ if ((p_mq_parm->mq_strucID == MQ_STRUCTID_UID || p_mq_parm->mq_strucID == MQ_STRUCTID_UID_EBCDIC) && tvb_captured_length_remaining(tvb, offset) > 0)
{
gint iSizeUID;
/* iSizeUID = (iVersionID < 5 ? 28 : 132); guess */
@@ -3343,7 +3343,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (iSizeUID != 28 && iSizeUID != 132)
iSizeUID = 0;
- if (iSizeUID != 0 && tvb_length_remaining(tvb, offset) >= iSizeUID)
+ if (iSizeUID != 0 && tvb_captured_length_remaining(tvb, offset) >= iSizeUID)
{
guint8 *sUserId;
sUserId = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, 12, p_mq_parm->mq_str_enc);
@@ -3372,7 +3372,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
offset += iSizeUID;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
offset += dissect_mq_od(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize);
@@ -3393,7 +3393,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += iSizePMO;
bPayload = TRUE;
}
- if (tvb_length_remaining(tvb, offset) >= 4)
+ if (tvb_captured_length_remaining(tvb, offset) >= 4)
{
if (bPayload == TRUE && (p_mq_parm->mq_opcode != MQ_TST_ASYNC_MESSAGE))
{
@@ -3414,18 +3414,18 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (bPayload == TRUE)
{
- if (iSizePayload != 0 && tvb_length_remaining(tvb, offset) > 0)
+ if (iSizePayload != 0 && tvb_captured_length_remaining(tvb, offset) > 0)
{
/* For the following header structures, each structure has a "format" field
which announces the type of the following structure. For dissection we
do not use it and rely on the structid instead. */
guint32 iHeadersLength = 0;
- if (tvb_length_remaining(tvb, offset) >= 4)
+ if (tvb_captured_length_remaining(tvb, offset) >= 4)
{
gint iSizeMD2 = 0;
p_mq_parm->mq_strucID = tvb_get_ntohl(tvb, offset);
- if ((p_mq_parm->mq_strucID == MQ_STRUCTID_XQH || p_mq_parm->mq_strucID == MQ_STRUCTID_XQH_EBCDIC) && tvb_length_remaining(tvb, offset) >= 104)
+ if ((p_mq_parm->mq_strucID == MQ_STRUCTID_XQH || p_mq_parm->mq_strucID == MQ_STRUCTID_XQH_EBCDIC) && tvb_captured_length_remaining(tvb, offset) >= 104)
{
/* if MD.format == MQXMIT */
gint iSizeXQH = 104;
@@ -3448,9 +3448,9 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
iHeadersLength += iSizeMD2;
}
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
- if ((p_mq_parm->mq_strucID == MQ_STRUCTID_DLH || p_mq_parm->mq_strucID == MQ_STRUCTID_DLH_EBCDIC) && tvb_length_remaining(tvb, offset) >= 172)
+ if ((p_mq_parm->mq_strucID == MQ_STRUCTID_DLH || p_mq_parm->mq_strucID == MQ_STRUCTID_DLH_EBCDIC) && tvb_captured_length_remaining(tvb, offset) >= 172)
{
/* if MD.format == MQDEAD */
gint iSizeDLH = 172;
@@ -3481,7 +3481,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
offset += iSizeDLH;
iHeadersLength += iSizeDLH;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
if ((p_mq_parm->mq_strucID == MQ_STRUCTID_MDE || p_mq_parm->mq_strucID == MQ_STRUCTID_MDE_EBCDIC
|| p_mq_parm->mq_strucID == MQ_STRUCTID_CIH || p_mq_parm->mq_strucID == MQ_STRUCTID_CIH_EBCDIC
@@ -3489,7 +3489,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|| p_mq_parm->mq_strucID == MQ_STRUCTID_RFH || p_mq_parm->mq_strucID == MQ_STRUCTID_RFH_EBCDIC
|| p_mq_parm->mq_strucID == MQ_STRUCTID_RMH || p_mq_parm->mq_strucID == MQ_STRUCTID_RMH_EBCDIC
|| p_mq_parm->mq_strucID == MQ_STRUCTID_WIH || p_mq_parm->mq_strucID == MQ_STRUCTID_WIH_EBCDIC)
- && tvb_length_remaining(tvb, offset) >= 12)
+ && tvb_captured_length_remaining(tvb, offset) >= 12)
{
/* Dissect the generic part of the other pre-defined headers */
/* We assume that only one such header is present */
@@ -3503,7 +3503,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
p_mq_parm->mq_head_ccsid.encod = tvb_get_guint32_endian(tvb, offset + 12, p_mq_parm->mq_int_enc);
p_mq_parm->mq_head_ccsid.ccsid = tvb_get_guint32_endian(tvb, offset + 16, p_mq_parm->mq_int_enc);
- if (tvb_length_remaining(tvb, offset) >= iSizeHeader)
+ if (tvb_captured_length_remaining(tvb, offset) >= iSizeHeader)
{
gint iTmp;
gint iVer;
@@ -3654,7 +3654,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
offset += iSizeHeader;
iHeadersLength += iSizeHeader;
- p_mq_parm->mq_strucID = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
+ p_mq_parm->mq_strucID = (tvb_captured_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
p_mq_parm->mq_str_enc = oEnc;
}
}
@@ -3683,10 +3683,10 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(data_handle, next_tvb, pinfo, mqroot_tree);
}
}
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
/* After all recognised structures have been dissected, process remaining structure*/
- if (tvb_length_remaining(tvb, offset) >= 4)
+ if (tvb_captured_length_remaining(tvb, offset) >= 4)
{
p_mq_parm->mq_strucID = tvb_get_ntohl(tvb, offset);
if (tree)
@@ -3722,7 +3722,7 @@ static int reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
/* Reassembly of the MQ messages that span several PDU (several TSH) */
/* Typically a TCP PDU is 1460 bytes and a MQ PDU is 32766 bytes */
- if (tvb_length(tvb) < 28)
+ if (tvb_captured_length(tvb) < 28)
return 0;
memset(&mq_parm, 0, sizeof(mq_parm_t));
@@ -3877,7 +3877,7 @@ static int reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
next_tvb = tvb;
}
dissect_mq_pdu(next_tvb, pinfo, mq_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
else
{
@@ -3888,7 +3888,7 @@ static int reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
val_to_str(iOpcd, mq_opcode_vals, "Unknown (0x%02x)"),
iHdl, iGlbMsgIdx, iSegmIndex, iSegLength);
dissect_mq_pdu(tvb, pinfo, mq_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
else
@@ -3899,19 +3899,19 @@ static int reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
/* MQ segment is the first of a unreassembled series */
col_append_str(pinfo->cinfo, COL_INFO, " [Unreassembled MQ]");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
/* Reassembly not enabled or non-fragmented message */
dissect_mq_pdu(tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint get_mq_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
- if (tvb_length_remaining(tvb, offset) >= 8)
+ if (tvb_captured_length_remaining(tvb, offset) >= 8)
{
guint32 mq_strucID = tvb_get_ntohl(tvb, 0);
if ( (mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx || (mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC )
@@ -3925,7 +3925,7 @@ static guint get_mq_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
static int dissect_mq_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, mq_desegment, 28, get_mq_pdu_len, reassemble_mq, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void dissect_mq_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -3936,7 +3936,7 @@ static void dissect_mq_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static gboolean dissect_mq_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint iProto, void *data)
{
- if (tvb_length(tvb) >= 28)
+ if (tvb_captured_length(tvb) >= 28)
{
guint32 mq_strucID = tvb_get_ntohl(tvb, 0);
if ( (mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx || (mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC )
diff --git a/epan/dissectors/packet-mrcpv2.c b/epan/dissectors/packet-mrcpv2.c
index 7faed73596..f910a43ef0 100644
--- a/epan/dissectors/packet-mrcpv2.c
+++ b/epan/dissectors/packet-mrcpv2.c
@@ -455,7 +455,7 @@ dissect_mrcpv2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = 0;
if (tree) {
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
ti = proto_tree_add_item(tree, proto_mrcpv2, tvb, 0, -1, ENC_UTF_8);
mrcpv2_tree = proto_item_add_subtree(ti, ett_mrcpv2);
@@ -958,7 +958,7 @@ dissect_mrcpv2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Return the amount of data this dissector was able to dissect */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* get the length of the MRCP message */
@@ -1006,7 +1006,7 @@ dissect_mrcpv2_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
gint sp_offset;
int value;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len < MRCPV2_MIN_LENGTH) /* too short, can't conclude if it's mrcp */
return 0;
diff --git a/epan/dissectors/packet-mrdisc.c b/epan/dissectors/packet-mrdisc.c
index 5935f87f5d..814bb74128 100644
--- a/epan/dissectors/packet-mrdisc.c
+++ b/epan/dissectors/packet-mrdisc.c
@@ -193,7 +193,7 @@ dissect_mrdisc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int o
/* 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_mrdisc, tvb, offset, 0, ENC_NA);
diff --git a/epan/dissectors/packet-ms-mms.c b/epan/dissectors/packet-ms-mms.c
index 75fa35ca8b..b917d0ede1 100644
--- a/epan/dissectors/packet-ms-mms.c
+++ b/epan/dissectors/packet-ms-mms.c
@@ -323,7 +323,7 @@ static gint dissect_msmms_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* Work out what type of packet this is and dissect it as such */
/* Just don't dissect if can't even read command signature */
- if (tvb_length(tvb) < 8)
+ if (tvb_captured_length(tvb) < 8)
{
return 0;
}
diff --git a/epan/dissectors/packet-msdp.c b/epan/dissectors/packet-msdp.c
index 66473b65da..d97f377c8b 100644
--- a/epan/dissectors/packet-msdp.c
+++ b/epan/dissectors/packet-msdp.c
@@ -225,7 +225,7 @@ dissect_msdp(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_text(msdp_tree, tvb, offset,
-1, "Trailing junk");
@@ -301,7 +301,7 @@ static void dissect_msdp_sa(tvbuff_t *tvb, packet_info *pinfo,
length);
enc_tree = proto_item_add_subtree(ei, ett_msdp_sa_enc_data);
- available_length = tvb_length_remaining(tvb, *offset);
+ available_length = tvb_captured_length_remaining(tvb, *offset);
reported_length = tvb_reported_length_remaining(tvb, *offset);
DISSECTOR_ASSERT(available_length >= 0);
DISSECTOR_ASSERT(reported_length >= 0);
diff --git a/epan/dissectors/packet-msnip.c b/epan/dissectors/packet-msnip.c
index fc8aaf4a23..14acebdae7 100644
--- a/epan/dissectors/packet-msnip.c
+++ b/epan/dissectors/packet-msnip.c
@@ -222,7 +222,7 @@ dissect_msnip(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_msnip, tvb, offset, -1, ENC_NA);
diff --git a/epan/dissectors/packet-msrp.c b/epan/dissectors/packet-msrp.c
index df48c4e787..3d8d20314e 100644
--- a/epan/dissectors/packet-msrp.c
+++ b/epan/dissectors/packet-msrp.c
@@ -349,7 +349,7 @@ check_msrp_header(tvbuff_t *tvb)
* is not longer than what's in the buffer, so the
* "tvb_get_ptr()" calls below won't throw exceptions. *
*/
- if(tvb_length(tvb) < 4 || tvb_get_ntohl(tvb, 0) != 0x4d535250 /* MSRP */){
+ if(tvb_captured_length(tvb) < 4 || tvb_get_ntohl(tvb, 0) != 0x4d535250 /* MSRP */){
return FALSE;
}
@@ -398,7 +398,7 @@ find_end_line(tvbuff_t *tvb, gint start)
{
gint offset = start, next_offset, linelen;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
/* 'desegment' is FALSE so will set next_offset to beyond the end of
the buffer if no line ending is found */
linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE);
@@ -730,7 +730,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}/* if tree */
return message_end_offset;
- /* return tvb_length(tvb); */
+ /* return tvb_captured_length(tvb); */
/* If this protocol has a sub-dissector call it here, see section 1.8 */
}
diff --git a/epan/dissectors/packet-mstp.c b/epan/dissectors/packet-mstp.c
index b309e15a77..708ade5212 100644
--- a/epan/dissectors/packet-mstp.c
+++ b/epan/dissectors/packet-mstp.c
@@ -189,7 +189,7 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset+2, 1, ENC_LITTLE_ENDIAN);
item = proto_tree_add_item(subtree, hf_mstp_frame_pdu_len, tvb,
offset+3, 2, ENC_BIG_ENDIAN);
- mstp_tvb_pdu_len = tvb_length_remaining(tvb, offset+6);
+ mstp_tvb_pdu_len = tvb_captured_length_remaining(tvb, offset+6);
/* check the length - which does not include the crc16 checksum */
if (mstp_tvb_pdu_len > 2) {
if (mstp_frame_pdu_len > (mstp_tvb_pdu_len-2)) {
diff --git a/epan/dissectors/packet-mtp2.c b/epan/dissectors/packet-mtp2.c
index 87b99ba580..9fee125af4 100644
--- a/epan/dissectors/packet-mtp2.c
+++ b/epan/dissectors/packet-mtp2.c
@@ -134,7 +134,7 @@ dissect_mtp2_header(tvbuff_t *su_tvb, proto_item *mtp2_tree)
static guint16
mtp2_fcs16(tvbuff_t * tvbuff)
{
- guint len = tvb_length(tvbuff)-2;
+ guint len = tvb_captured_length(tvbuff)-2;
/* Check for Invalid Length */
if (len == 0)
@@ -159,7 +159,7 @@ mtp2_decode_crc16(tvbuff_t *tvb, proto_tree *fh_tree, packet_info *pinfo)
/*
* Do we have the entire packet, and does it include a 2-byte FCS?
*/
- len = tvb_length_remaining(tvb, proto_offset);
+ len = tvb_captured_length_remaining(tvb, proto_offset);
reported_len = tvb_reported_length_remaining(tvb, proto_offset);
if (reported_len < 2 || len < 0) {
/*
@@ -282,10 +282,10 @@ dissect_mtp2_msu(tvbuff_t *su_tvb, packet_info *pinfo, proto_item *mtp2_item, pr
col_set_str(pinfo->cinfo, COL_INFO, "MSU ");
if (use_extended_sequence_numbers) {
- sif_sio_length = tvb_length(su_tvb) - EXTENDED_HEADER_LENGTH;
+ sif_sio_length = tvb_captured_length(su_tvb) - EXTENDED_HEADER_LENGTH;
sif_sio_tvb = tvb_new_subset_length(su_tvb, EXTENDED_SIO_OFFSET, sif_sio_length);
} else {
- sif_sio_length = tvb_length(su_tvb) - HEADER_LENGTH;
+ sif_sio_length = tvb_captured_length(su_tvb) - HEADER_LENGTH;
sif_sio_tvb = tvb_new_subset_length(su_tvb, SIO_OFFSET, sif_sio_length);
}
call_dissector(mtp3_handle, sif_sio_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c
index 97c5757e9a..a876e2f20f 100644
--- a/epan/dissectors/packet-mtp3.c
+++ b/epan/dissectors/packet-mtp3.c
@@ -767,7 +767,7 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
memcpy(&(tap_rec->addr_dpc), mtp3_addr_dpc, sizeof(mtp3_addr_pc_t));
tap_rec->si_code = (tvb_get_guint8(tvb, SIO_OFFSET) & SERVICE_INDICATOR_MASK);
- tap_rec->size = tvb_length(tvb);
+ tap_rec->size = tvb_captured_length(tvb);
tap_queue_packet(mtp3_tap, pinfo, tap_rec);
diff --git a/epan/dissectors/packet-mtp3mg.c b/epan/dissectors/packet-mtp3mg.c
index 97e861d243..91ca756a87 100644
--- a/epan/dissectors/packet-mtp3mg.c
+++ b/epan/dissectors/packet-mtp3mg.c
@@ -429,7 +429,7 @@ dissect_mtp3mg_unknown_message(tvbuff_t *tvb, proto_tree *tree)
{
guint8 message_length;
- message_length = tvb_length(tvb);
+ message_length = tvb_captured_length(tvb);
proto_tree_add_text(tree, tvb, 0, message_length,
"Unknown message (%u byte%s)", message_length,
plurality(message_length, "", "s"));
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index 4708091917..aef46238bb 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -175,7 +175,7 @@ base64_decode(packet_info *pinfo, tvbuff_t *b64_tvb, char *name)
{
char *data;
tvbuff_t *tvb;
- data = tvb_get_string_enc(wmem_packet_scope(), b64_tvb, 0, tvb_length(b64_tvb), ENC_ASCII);
+ data = tvb_get_string_enc(wmem_packet_scope(), b64_tvb, 0, tvb_captured_length(b64_tvb), ENC_ASCII);
tvb = base64_to_tvb(b64_tvb, data);
add_new_data_source(pinfo, tvb, name);
@@ -446,13 +446,13 @@ find_first_boundary(tvbuff_t *tvb, gint start, const guint8 *boundary,
{
gint offset = start, next_offset, line_len, boundary_start;
- while (tvb_length_remaining(tvb, offset + 2 + boundary_len) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset + 2 + boundary_len) > 0) {
boundary_start = offset;
if (((tvb_strneql(tvb, offset, (const guint8 *)"--", 2) == 0)
&& (tvb_strneql(tvb, offset + 2, boundary, boundary_len) == 0)))
{
/* Boundary string; now check if last */
- if ((tvb_length_remaining(tvb, offset + 2 + boundary_len + 2) >= 0)
+ if ((tvb_captured_length_remaining(tvb, offset + 2 + boundary_len + 2) >= 0)
&& (tvb_strneql(tvb, offset + 2 + boundary_len,
(const guint8 *)"--", 2) == 0)) {
*last_boundary = TRUE;
@@ -492,7 +492,7 @@ find_next_boundary(tvbuff_t *tvb, gint start, const guint8 *boundary,
{
gint offset = start, next_offset, line_len, boundary_start;
- while (tvb_length_remaining(tvb, offset + 2 + boundary_len) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset + 2 + boundary_len) > 0) {
line_len = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE);
if (line_len == -1) {
return -1;
@@ -502,7 +502,7 @@ find_next_boundary(tvbuff_t *tvb, gint start, const guint8 *boundary,
&& (tvb_strneql(tvb, next_offset + 2, boundary, boundary_len) == 0)))
{
/* Boundary string; now check if last */
- if ((tvb_length_remaining(tvb, next_offset + 2 + boundary_len + 2) >= 0)
+ if ((tvb_captured_length_remaining(tvb, next_offset + 2 + boundary_len + 2) >= 0)
&& (tvb_strneql(tvb, next_offset + 2 + boundary_len,
(const guint8 *)"--", 2) == 0)) {
*last_boundary = TRUE;
@@ -604,7 +604,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
/* Look for the end of the header (denoted by cr)
* 3:d argument to imf_find_field_end() maxlen; must be last offset in the tvb.
*/
- next_offset = imf_find_field_end(tvb, offset, tvb_length_remaining(tvb, offset)+offset, &last_field);
+ next_offset = imf_find_field_end(tvb, offset, tvb_captured_length_remaining(tvb, offset)+offset, &last_field);
/* If cr not found, won't have advanced - get out to avoid infinite loop! */
if (next_offset == offset) {
break;
@@ -795,7 +795,7 @@ static int dissect_multipart(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
"The multipart dissector could not find "
"the required boundary parameter.");
call_dissector(data_handle, tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
boundary = (guint8 *)m_info->boundary;
boundary_len = m_info->boundary_length;
@@ -829,7 +829,7 @@ static int dissect_multipart(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
call_dissector(data_handle, tvb, pinfo, subtree);
/* Clean up the dynamically allocated memory */
cleanup_multipart_info(m_info);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
* Process the encapsulated bodies
@@ -840,18 +840,18 @@ static int dissect_multipart(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (header_start == -1) {
/* Clean up the dynamically allocated memory */
cleanup_multipart_info(m_info);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
/*
* Process the multipart trailer
*/
- if (tvb_length_remaining(tvb, header_start) > 0) {
+ if (tvb_captured_length_remaining(tvb, header_start) > 0) {
proto_tree_add_text(subtree, tvb, header_start, -1, "Trailer");
}
/* Clean up the dynamically allocated memory */
cleanup_multipart_info(m_info);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Returns index of method in multipart_headers */
diff --git a/epan/dissectors/packet-nas_eps.c b/epan/dissectors/packet-nas_eps.c
index 8ad5e7fbf4..e7757da938 100644
--- a/epan/dissectors/packet-nas_eps.c
+++ b/epan/dissectors/packet-nas_eps.c
@@ -1018,7 +1018,7 @@ unpack_eps_mid_digits(tvbuff_t *tvb) {
int offset = 0;
char *digit_str;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
digit_str = (char *)wmem_alloc(wmem_packet_scope(), length*2);
@@ -4671,7 +4671,7 @@ disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
guint8 oct;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/*
* EPS bearer identity 9.3.2
*/
@@ -4736,7 +4736,7 @@ dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
guint8 security_header_type, oct;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/* 9.3.1 Security header type */
if (second_header) {
@@ -4820,7 +4820,7 @@ dissect_nas_eps_plain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Protocol discriminator Protocol discriminator 9.2 M V 1/2 */
proto_tree_add_item(nas_eps_tree, hf_gsm_a_L3_protocol_discriminator, tvb, 0, 1, ENC_BIG_ENDIAN);
offset++;
- nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, tvb_length(tvb)-offset);
+ nas_emm_service_req(tvb, nas_eps_tree, pinfo, offset, tvb_captured_length(tvb)-offset);
return;
}
@@ -4897,7 +4897,7 @@ dissect_nas_eps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint32 len;
guint32 msg_auth_code;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/* The protected NAS message header is 6 octets long, and the NAS message header is at least 2 octets long. */
/* If the length of the tvbuffer is less than 8 octets, we can safely conclude the message is not protected. */
if (len < 8) {
diff --git a/epan/dissectors/packet-nb_rtpmux.c b/epan/dissectors/packet-nb_rtpmux.c
index a254be1cea..305408666d 100644
--- a/epan/dissectors/packet-nb_rtpmux.c
+++ b/epan/dissectors/packet-nb_rtpmux.c
@@ -79,7 +79,7 @@ dissect_nb_rtpmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
*/
/* Check that there's enough data */
- if (tvb_length(tvb) < 6)
+ if (tvb_captured_length(tvb) < 6)
return 0;
/* Make entries in Protocol column and Info column on summary display */
@@ -141,7 +141,7 @@ dissect_nb_rtpmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
/* We have an RTP payload. */
if (rtpdissector)
{
- captured_length = tvb_length_remaining(tvb, offset + 5);
+ captured_length = tvb_captured_length_remaining(tvb, offset + 5);
if (captured_length > (gint)length)
captured_length = length;
next_tvb = tvb_new_subset(tvb, offset+5, captured_length,
@@ -160,7 +160,7 @@ dissect_nb_rtpmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
}
/* 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-nbap.c b/epan/dissectors/packet-nbap.c
index 1f0d1a8a81..eba586afe5 100644
--- a/epan/dissectors/packet-nbap.c
+++ b/epan/dissectors/packet-nbap.c
@@ -8718,7 +8718,7 @@ dissect_nbap_BindingID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
return offset;
BindingID_port = tvb_get_ntohs(parameter_tvb,0);
- if(tvb_length(parameter_tvb)==2){
+ if(tvb_captured_length(parameter_tvb)==2){
proto_item_append_text(actx->created_item, " (%u)",BindingID_port);
}
@@ -8743,7 +8743,7 @@ dissect_nbap_TransportLayerAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
if (!parameter_tvb)
return offset;
/* Get the length */
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
subtree = proto_item_add_subtree(actx->created_item, ett_nbap_TransportLayerAddress);
if (tvb_len==4){
/* IPv4 */
@@ -55172,30 +55172,30 @@ static int dissect_NULL_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tre
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(nbap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(nbap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(nbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(nbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(nbap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(nbap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(nbap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(nbap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(nbap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(nbap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void add_hsdsch_bind(packet_info *pinfo){
address null_addr;
diff --git a/epan/dissectors/packet-nbd.c b/epan/dissectors/packet-nbd.c
index 5348527478..afea149abc 100644
--- a/epan/dissectors/packet-nbd.c
+++ b/epan/dissectors/packet-nbd.c
@@ -113,7 +113,7 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
pinfo->srcport, pinfo->destport, 0);
if (conversation == NULL) {
/* No, so just return the rest of the current packet */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
* Do we have a state structure for this conv
@@ -121,7 +121,7 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
nbd_info = (nbd_conv_info_t *)conversation_get_proto_data(conversation, proto_nbd);
if (!nbd_info) {
/* No, so just return the rest of the current packet */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if(!pinfo->fd->flags.visited){
/*
@@ -135,7 +135,7 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
nbd_trans=(nbd_transaction_t *)wmem_tree_lookup32_array(nbd_info->unacked_pdus, hkey);
if(!nbd_trans){
/* No, so just return the rest of the current packet */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
} else {
/*
@@ -152,7 +152,7 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
nbd_trans=(nbd_transaction_t *)wmem_tree_lookup32_array(nbd_info->acked_pdus, hkey);
if(!nbd_trans){
/* No, so just return the rest of the current packet */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
/* If this is a read response we must add the datalen to
@@ -368,7 +368,7 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
@@ -377,7 +377,7 @@ dissect_nbd_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
guint32 magic, type;
/* We need at least this much to tell whether this is NBD or not */
- if(tvb_length(tvb)<4){
+ if(tvb_captured_length(tvb)<4){
return FALSE;
}
@@ -386,7 +386,7 @@ dissect_nbd_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
switch(magic){
case NBD_REQUEST_MAGIC:
/* requests are 28 bytes or more */
- if(tvb_length(tvb)<28){
+ if(tvb_captured_length(tvb)<28){
return FALSE;
}
/* verify type */
@@ -404,7 +404,7 @@ dissect_nbd_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
return TRUE;
case NBD_RESPONSE_MAGIC:
/* responses are 16 bytes or more */
- if(tvb_length(tvb)<16){
+ if(tvb_captured_length(tvb)<16){
return FALSE;
}
tcp_dissect_pdus(tvb, pinfo, tree, nbd_desegment, 16, get_nbd_tcp_pdu_len, dissect_nbd_tcp_pdu, data);
diff --git a/epan/dissectors/packet-nbipx.c b/epan/dissectors/packet-nbipx.c
index 23b4d5e051..333a8bc6ec 100644
--- a/epan/dissectors/packet-nbipx.c
+++ b/epan/dissectors/packet-nbipx.c
@@ -438,7 +438,7 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
dissect_netbios_payload(next_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c
index 0e7f1ae5fe..4ac278ef88 100644
--- a/epan/dissectors/packet-nbns.c
+++ b/epan/dissectors/packet-nbns.c
@@ -1572,7 +1572,7 @@ dissect_continuation_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(nbss_tree, tvb, 0, -1, "Continuation data");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1597,7 +1597,7 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NBSS");
col_clear(pinfo->cinfo, COL_INFO);
- max_data = tvb_length(tvb);
+ max_data = tvb_captured_length(tvb);
msg_type = tvb_get_guint8(tvb, offset);
@@ -1653,7 +1653,7 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
* So if it is a SESSION_MESSAGE and SMB1 or SMB2
* mark it as is_cifs.
*/
- if (tvb_length_remaining(tvb, offset) >= 8
+ if (tvb_captured_length_remaining(tvb, offset) >= 8
&& tvb_get_guint8(tvb,offset+0) == SESSION_MESSAGE
&& tvb_get_guint8(tvb,offset+5) == 'S'
&& tvb_get_guint8(tvb,offset+6) == 'M'
@@ -1795,7 +1795,7 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
*/
pinfo->desegment_offset = offset;
pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
@@ -1821,7 +1821,7 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
* there is an SMB header there ...
*/
if( ((int)plen>tvb_reported_length_remaining(tvb, offset))
- &&(tvb_length_remaining(tvb, offset) >= 8)
+ &&(tvb_captured_length_remaining(tvb, offset) >= 8)
&&(tvb_get_guint8(tvb,offset+5) == 'S')
&&(tvb_get_guint8(tvb,offset+6) == 'M')
&&(tvb_get_guint8(tvb,offset+7) == 'B') ){
@@ -1845,7 +1845,7 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
*/
pinfo->desegment_offset = offset;
pinfo->desegment_len = plen - length_remaining;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
@@ -1863,7 +1863,7 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
offset += plen;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-ncp-nmas.c b/epan/dissectors/packet-ncp-nmas.c
index a20aadef95..e428a39ed6 100644
--- a/epan/dissectors/packet-ncp-nmas.c
+++ b/epan/dissectors/packet-ncp-nmas.c
@@ -191,7 +191,7 @@ static const value_string nmas_errors_enum[] = {
static int
align_4(tvbuff_t *tvb, int aoffset)
{
- if (tvb_length_remaining(tvb, aoffset) > 4 ) {
+ if (tvb_captured_length_remaining(tvb, aoffset) > 4 ) {
return (aoffset%4);
}
return 0;
diff --git a/epan/dissectors/packet-ncp-sss.c b/epan/dissectors/packet-ncp-sss.c
index 5a4148b9e0..bb23c750d3 100644
--- a/epan/dissectors/packet-ncp-sss.c
+++ b/epan/dissectors/packet-ncp-sss.c
@@ -437,7 +437,7 @@ sss_string(tvbuff_t* tvb, int hfinfo, proto_tree *sss_tree, int offset, gboolean
} else {
str_length = length;
}
- length_remaining = tvb_length_remaining(tvb, foffset);
+ length_remaining = tvb_captured_length_remaining(tvb, foffset);
if (length_remaining <= 0) {
return foffset;
}
@@ -493,7 +493,7 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
proto_item *aitem;
- if (tvb_length_remaining(tvb, foffset)<4) {
+ if (tvb_captured_length_remaining(tvb, foffset)<4) {
return;
}
foffset = 6;
@@ -508,7 +508,7 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
switch (subfunc) {
case 1:
- aitem = proto_tree_add_text(ncp_tree, tvb, foffset, tvb_length_remaining(tvb, foffset), "Packet Type: %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
+ aitem = proto_tree_add_text(ncp_tree, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), "Packet Type: %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
atree = proto_item_add_subtree(aitem, ett_sss);
proto_tree_add_item(atree, hf_ping_version, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
foffset += 4;
@@ -550,17 +550,17 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
packets and then we will see these as malformed packets.
So check to make sure we still have data in the packet anytime
we read a secret. */
- if (tvb_length_remaining(tvb, foffset) > 4) {
+ if (tvb_captured_length_remaining(tvb, foffset) > 4) {
/*foffset =*/ sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
}
break;
case 2:
foffset += 4;
foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
- if (tvb_length_remaining(tvb, foffset) > 4) {
+ if (tvb_captured_length_remaining(tvb, foffset) > 4) {
msg_length = tvb_get_letohl(tvb, foffset);
foffset += 4;
- if (tvb_length_remaining(tvb, foffset) < (gint) msg_length) {
+ if (tvb_captured_length_remaining(tvb, foffset) < (gint) msg_length) {
proto_tree_add_item(atree, hf_enc_data, tvb, foffset, -1, ENC_NA);
} else {
proto_tree_add_item(atree, hf_enc_data, tvb, foffset, msg_length, ENC_NA);
@@ -570,7 +570,7 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
case 3:
case 4:
foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
- if (tvb_length_remaining(tvb, foffset) > 4) {
+ if (tvb_captured_length_remaining(tvb, foffset) > 4) {
/*foffset =*/ sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
}
break;
@@ -578,7 +578,7 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
break;
case 6:
foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
- if (tvb_length_remaining(tvb, foffset) > 4) {
+ if (tvb_captured_length_remaining(tvb, foffset) > 4) {
/*foffset =*/ sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
}
break;
@@ -600,9 +600,9 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
if (request_value) {
request_value->req_nds_flags=255;
}
- if (tvb_length_remaining(tvb, foffset) > 8) {
+ if (tvb_captured_length_remaining(tvb, foffset) > 8) {
foffset += 4;
- proto_tree_add_item(ncp_tree, hf_enc_data, tvb, foffset, tvb_length_remaining(tvb, foffset), ENC_NA);
+ proto_tree_add_item(ncp_tree, hf_enc_data, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), ENC_NA);
}
}
break;
@@ -632,7 +632,7 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
foffset = 8;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NSSS");
- if (tvb_length_remaining(tvb, foffset)<4) {
+ if (tvb_captured_length_remaining(tvb, foffset)<4) {
return;
}
aitem = proto_tree_add_text(ncp_tree, tvb, foffset, -1, "Function: %s", val_to_str_const(subfunc, sss_func_enum, "Unknown"));
@@ -649,7 +649,7 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
subverb = request_value->req_nds_flags;
str = try_val_to_str(subverb, sss_verb_enum);
if (str) {
- proto_tree_add_text(atree, tvb, foffset, tvb_length_remaining(tvb, foffset), "Verb: %s", str);
+ proto_tree_add_text(atree, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), "Verb: %s", str);
}
}
proto_tree_add_item(atree, hf_length, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
@@ -669,7 +669,7 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
/*foffset+=4;*/
} else {
proto_tree_add_text(atree, tvb, foffset, 4, "Return Code: Success (0x00000000)");
- if (tvb_length_remaining(tvb, foffset) > 8) {
+ if (tvb_captured_length_remaining(tvb, foffset) > 8) {
foffset += 4;
if (request_value && subverb == 6) {
foffset += 4;
@@ -677,25 +677,25 @@ dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint
foffset += 8;
for (i=0; i<number_of_items; i++) {
length_of_string = find_delimiter(tvb, foffset);
- if (length_of_string > tvb_length_remaining(tvb, foffset)) {
+ if (length_of_string > tvb_captured_length_remaining(tvb, foffset)) {
return;
}
foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, length_of_string);
- if (tvb_length_remaining(tvb, foffset) < 8) {
+ if (tvb_captured_length_remaining(tvb, foffset) < 8) {
return;
}
foffset++;
}
} else {
- proto_tree_add_item(atree, hf_enc_data, tvb, foffset, tvb_length_remaining(tvb, foffset), ENC_NA);
+ proto_tree_add_item(atree, hf_enc_data, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), ENC_NA);
}
}
}
} else {
proto_tree_add_text(atree, tvb, foffset, 4, "Return Code: Success (0x00000000)");
- if (tvb_length_remaining(tvb, foffset) > 8) {
+ if (tvb_captured_length_remaining(tvb, foffset) > 8) {
foffset += 4;
- proto_tree_add_item(atree, hf_enc_data, tvb, foffset, tvb_length_remaining(tvb, foffset), ENC_NA);
+ proto_tree_add_item(atree, hf_enc_data, tvb, foffset, tvb_captured_length_remaining(tvb, foffset), ENC_NA);
}
}
break;
diff --git a/epan/dissectors/packet-ncp.c b/epan/dissectors/packet-ncp.c
index 8398dc8264..d4ccfd56cd 100644
--- a/epan/dissectors/packet-ncp.c
+++ b/epan/dissectors/packet-ncp.c
@@ -657,7 +657,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case NCP_ALLOCATE_SLOT: /* Allocate Slot Request */
- length_remaining = tvb_length_remaining(tvb, commhdr + 4);
+ length_remaining = tvb_captured_length_remaining(tvb, commhdr + 4);
if (length_remaining > 4) {
testvar = tvb_get_ntohl(tvb, commhdr+4);
if (testvar == 0x4c495020) {
@@ -685,7 +685,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
switch (header.type) {
case NCP_ALLOCATE_SLOT: /* Allocate Slot Request */
- length_remaining = tvb_length_remaining(tvb, commhdr + 4);
+ length_remaining = tvb_captured_length_remaining(tvb, commhdr + 4);
if (length_remaining > 4) {
testvar = tvb_get_ntohl(tvb, commhdr+4);
if (testvar == 0x4c495020) {
@@ -801,7 +801,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* length of the packet, but that's arguably a
* feature in this case.
*/
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > data_len)
length_remaining = data_len;
if (data_len != 0) {
@@ -849,7 +849,7 @@ get_ncp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
*/
signature = tvb_get_ntohl(tvb, offset);
if (signature != NCPIP_RQST && signature != NCPIP_RPLY)
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
/*
* Get the length of the NCP-over-TCP packet. Strip off the "has
@@ -863,7 +863,7 @@ static int
dissect_ncp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_ncp_common(tvb, pinfo, tree, TRUE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -871,7 +871,7 @@ dissect_ncp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, ncp_desegment, 8, get_ncp_pdu_len,
dissect_ncp_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index 7fdc4fe714..1329aec3dd 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -2421,7 +2421,7 @@ static void free_proto_tree(void *tree)
static guint32
align_4(tvbuff_t *tvb, guint32 aoffset)
{
- if(tvb_length_remaining(tvb, aoffset) > 4 )
+ if(tvb_captured_length_remaining(tvb, aoffset) > 4 )
{
return (aoffset%4);
}
@@ -2437,7 +2437,7 @@ get_string(tvbuff_t* tvb, guint offset, guint str_length)
gint length_remaining = 0;
gint max_length = (str_length < NW_UNI_MAX) ? str_length : NW_UNI_MAX;
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if((gint)str_length > length_remaining)
{
THROW(ReportedBoundsError);
@@ -3057,7 +3057,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
break;
case 0x00000009: /* Binary String */
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
- length_remaining = tvb_length_remaining(tvb, voffset);
+ length_remaining = tvb_captured_length_remaining(tvb, voffset);
if(length_remaining == -1 || value1 > (guint32) length_remaining)
{
break;
@@ -3070,7 +3070,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
break;
case 0x0000000d: /* Binary String List */
value1 = tvb_get_letohl(tvb, voffset); /* Overall length of field list */
- length_remaining = tvb_length_remaining(tvb, voffset);
+ length_remaining = tvb_captured_length_remaining(tvb, voffset);
if(length_remaining == -1 || value1 > (guint32) length_remaining)
{
break;
@@ -3082,7 +3082,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
for (r=1; r<=number_of_items; r++)
{
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
- length_remaining = tvb_length_remaining(tvb, voffset);
+ length_remaining = tvb_captured_length_remaining(tvb, voffset);
if(length_remaining == -1 || value1 > (guint32) length_remaining)
{
break;
@@ -3096,7 +3096,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
break;
case 0x00000015: /* Stream */
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
- length_remaining = tvb_length_remaining(tvb, voffset);
+ length_remaining = tvb_captured_length_remaining(tvb, voffset);
if(length_remaining == -1 || value1 > (guint32) length_remaining)
{
break;
@@ -3246,7 +3246,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
for (r=1; r <= number_of_items; r++)
{
/* Trap for end of packet */
- if(tvb_length_remaining(tvb, voffset)<12)
+ if(tvb_captured_length_remaining(tvb, voffset)<12)
{
THROW(ReportedBoundsError);
}
@@ -4161,7 +4161,7 @@ process_search_expression(proto_tree *it_tree, tvbuff_t *tvb, nds_val *values)
break;
default: /* Unknown Iteration search Item type */
- if (tvb_length_remaining(tvb, ioffset) < 4) {
+ if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
THROW(ReportedBoundsError);
}
break;
@@ -4193,7 +4193,7 @@ process_search_subexpression(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pi
process_set_filter(it_subtree1, tvb, pinfo, values);
ioffset = values->voffset;
- if (tvb_length_remaining(tvb, ioffset) < 4) {
+ if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
THROW(ReportedBoundsError);
break;
}
@@ -4289,7 +4289,7 @@ process_set_filter(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, nds_v
process_search_subexpression(it_tree, tvb, pinfo, values);
break;
default: /* Unknown Iteration search type */
- if (tvb_length_remaining(tvb, ioffset) < 4) {
+ if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
THROW(ReportedBoundsError);
}
break;
@@ -4773,7 +4773,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
#if 0
ioffset += align_4(tvb, ioffset);
#endif
- if (tvb_length_remaining(tvb, ioffset) < 4) {
+ if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
THROW(ReportedBoundsError);
return;
}
@@ -4815,7 +4815,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
ioffset += align_4(tvb, ioffset);
break;
default:
- if (tvb_length_remaining(tvb, ioffset) < 4) {
+ if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
THROW(ReportedBoundsError);
}
return;
@@ -4890,7 +4890,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
/* For now we will just skip this offset. NEED TO ADD LOGIC TO HANDLE */
ioffset += 8;
- if (tvb_length_remaining(tvb, ioffset) < 4) {
+ if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
break;
}
}
@@ -4920,7 +4920,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
ioffset += 4;
break;
default:
- if (tvb_length_remaining(tvb, ioffset) < 4) {
+ if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
THROW(ReportedBoundsError);
}
return;
@@ -4928,7 +4928,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
}
it_verb = tvb_get_letohl(tvb, ioffset);
ioffset += 4;
- if (it_verb == IT_DONE || tvb_length_remaining(tvb, ioffset) < 4) {
+ if (it_verb == IT_DONE || tvb_captured_length_remaining(tvb, ioffset) < 4) {
verb_string = val_to_str_const(it_verb, iterator_subverbs, "Internal error processing NDS iteration verbs");
proto_tree_add_uint_format(it_tree, hf_ncp_nds_iterverb, tvb, ioffset-4, 4,
it_verb, "Iterator Verb: %d, (0x%04x), %s",
@@ -5155,7 +5155,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
2, event_num);
ioffset = ioffset + 2;
value5 = tvb_get_letohl(tvb, ioffset); /* length of field */
- if(value5 > tvb_length_remaining(tvb, ioffset))
+ if(value5 > tvb_captured_length_remaining(tvb, ioffset))
{
break;
}
@@ -5426,12 +5426,12 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
}
bvalue = bvalue*2;
ioffset += align_4(tvb, ioffset);
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
}
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -5941,12 +5941,12 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
if (bvalue==0) {
break;
}
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
}
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -6011,7 +6011,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
if(values->vflags != 5)
{
value1 = tvb_get_letohl(tvb, ioffset); /* length of field */
- length_remaining = tvb_length_remaining(tvb, ioffset);
+ length_remaining = tvb_captured_length_remaining(tvb, ioffset);
if(length_remaining == -1 || value1 > (guint32) length_remaining)
{
break;
@@ -6098,7 +6098,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
value2, temp_values.vstring);
ioffset = ioffset + value2;
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -6173,7 +6173,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
4, value1, "Default ACL %08x", value1);
ioffset = ioffset + 4;
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -6288,7 +6288,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
4, value1, "Default ACL %08x", value1);
ioffset = ioffset + 4;
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -6308,7 +6308,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
value1, values->vstring);
ioffset = ioffset + value1;
}
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -6327,7 +6327,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
value2, values->vstring);
ioffset = ioffset + value2;
}
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -6358,7 +6358,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
4, value1, "Privileges 0x%08x", value1);
ioffset = ioffset + 4;
}
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -6597,7 +6597,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
value3, values->vstring);
ioffset = ioffset + value3;
- if(tvb_length_remaining(tvb, ioffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
{
break;
}
@@ -6640,7 +6640,7 @@ dissect_ncp_89_6_request(tvbuff_t *tvb, proto_tree *volatile ncp_tree, guint32 o
proto_tree_add_item(ncp_tree, hf_ncp_directory_path, tvb, offset+2, string_len-2, TRUE);
}
offset += string_len;
- if(tvb_length_remaining(tvb, offset) < 4 )
+ if(tvb_captured_length_remaining(tvb, offset) < 4 )
{
break;
}
@@ -6718,7 +6718,7 @@ dissect_ncp_123_17_reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree)
break;
}
proto_item_set_end(aitem, tvb, loffset);
- if(tvb_length_remaining(tvb, loffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, loffset) < 4 )
{
break;
}
@@ -7074,7 +7074,7 @@ dissect_ncp_8x20reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree,
proto_item_set_end(aitem, tvb, loffset);
- if(tvb_length_remaining(tvb, loffset) < 4 )
+ if(tvb_captured_length_remaining(tvb, loffset) < 4 )
{
break;
}
@@ -7449,7 +7449,7 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
/* Determine which ncp_record to use. */
switch (type) {
case NCP_ALLOCATE_SLOT:
- length_remaining = tvb_length_remaining(tvb, 4);
+ length_remaining = tvb_captured_length_remaining(tvb, 4);
if (length_remaining > 4)
{
testvar = tvb_get_ntohl(tvb, 4);
@@ -9119,7 +9119,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
* is 0, as we checked it above. Is there any
* reason why we'd want to do a full dissection
* if the completion code isn't 0? */
- if (completion_code != 0 && tvb_length(tvb) == 8) {
+ if (completion_code != 0 && tvb_captured_length(tvb) == 8) {
return;
}
@@ -9171,7 +9171,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
/* Check to see if we need to report to the expert table */
trap_for_expert_event(ncp_tree, pinfo, ncp_rec, 1);
} else {
- if (tvb_length(tvb) > 8) {
+ if (tvb_captured_length(tvb) > 8) {
expert_item = proto_tree_add_text(ncp_tree, tvb, 8, -1,
"No request record found. Parsing is impossible.");
if (ncp_echo_err) {
diff --git a/epan/dissectors/packet-ndmp.c b/epan/dissectors/packet-ndmp.c
index dd20555d79..08b40c9883 100644
--- a/epan/dissectors/packet-ndmp.c
+++ b/epan/dissectors/packet-ndmp.c
@@ -572,7 +572,7 @@ check_ndmp_rm(tvbuff_t *tvb, packet_info *pinfo)
}
/* check that the header looks sane */
- len=tvb_length(tvb);
+ len=tvb_captured_length(tvb);
/* check the record marker that it looks sane.
* It has to be >=0 bytes or (arbitrary limit) <1Mbyte
*/
@@ -592,7 +592,7 @@ check_ndmp_hdr(tvbuff_t *tvb )
guint len;
guint32 tmp;
- len=tvb_length(tvb);
+ len=tvb_captured_length(tvb);
/* If the length is less than 24, it isn't a valid
header */
@@ -1395,7 +1395,7 @@ dissect_execute_cdb_cdb(tvbuff_t *tvb, int offset, packet_info *pinfo,
tvbuff_t *cdb_tvb;
int tvb_len, tvb_rlen;
- tvb_len=tvb_length_remaining(tvb, offset);
+ tvb_len=tvb_captured_length_remaining(tvb, offset);
if(tvb_len>16)
tvb_len=16;
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
@@ -1453,7 +1453,7 @@ dissect_execute_cdb_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, proto
tvbuff_t *data_tvb;
int tvb_len, tvb_rlen;
- tvb_len=tvb_length_remaining(tvb, offset);
+ tvb_len=tvb_captured_length_remaining(tvb, offset);
if(tvb_len>(int)payload_len)
tvb_len=payload_len;
tvb_rlen=tvb_reported_length_remaining(tvb, offset);
@@ -3051,7 +3051,7 @@ dissect_ndmp_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
if(ndmp_commands[i].cmd==0){
/* we do not know this message */
proto_tree_add_text(tree, tvb, offset, -1, "Unknown type of NDMP message: 0x%02x", nh->msg);
- offset+=tvb_length_remaining(tvb, offset);
+ offset+=tvb_captured_length_remaining(tvb, offset);
return offset;
}
@@ -3243,7 +3243,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
frag_msg = fragment_add_seq_check(&ndmp_reassembly_table,
tvb, 4, pinfo, seq, NULL,
frag_num,
- tvb_length_remaining(tvb, offset)-4,
+ tvb_captured_length_remaining(tvb, offset)-4,
!(ndmp_rm & RPC_RM_LASTFRAG));
new_tvb = process_reassembled_data(tvb, 4, pinfo, "Reassembled NDMP", frag_msg, &ndmp_frag_items, NULL, tree);
@@ -3282,7 +3282,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
proto_tree_add_text(ndmp_tree, tvb, 4, nbytes, "NDMP fragment data (%u byte%s)", nbytes, plurality(nbytes, "", "s"));
pinfo->fragmented = save_fragmented;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
else
@@ -3292,11 +3292,11 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
/* size of this NDMP PDU */
- size = tvb_length_remaining(new_tvb, offset);
+ size = tvb_captured_length_remaining(new_tvb, offset);
if (size < 24) {
/* too short to be NDMP */
pinfo->fragmented = save_fragmented;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -3306,7 +3306,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
if (!check_ndmp_hdr(new_tvb))
{
pinfo->fragmented = save_fragmented;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
nh.seq = tvb_get_ntohl(new_tvb, offset);
@@ -3403,7 +3403,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
pinfo->fragmented = save_fragmented;
col_set_writable(pinfo->cinfo, save_writable);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -3430,7 +3430,7 @@ check_if_ndmp(tvbuff_t *tvb, packet_info *pinfo)
}
/* check that the header looks sane */
- len=tvb_length(tvb);
+ len=tvb_captured_length(tvb);
/* check the record marker that it looks sane.
* It has to be >=24 bytes or (arbitrary limit) <1Mbyte
*/
@@ -3500,7 +3500,7 @@ dissect_ndmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
tcp_dissect_pdus(tvb, pinfo, tree, ndmp_desegment, 4,
get_ndmp_pdu_len, dissect_ndmp_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Called when doing a heuristic check;
@@ -3512,14 +3512,14 @@ dissect_ndmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
static int
dissect_ndmp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if (tvb_length(tvb) < 28)
+ if (tvb_captured_length(tvb) < 28)
return 0;
if (!check_if_ndmp(tvb, pinfo))
return 0;
tcp_dissect_pdus(tvb, pinfo, tree, ndmp_desegment, 28,
get_ndmp_pdu_len, dissect_ndmp_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c
index 6d26881607..9485b04237 100644
--- a/epan/dissectors/packet-ndps.c
+++ b/epan/dissectors/packet-ndps.c
@@ -2028,7 +2028,7 @@ static const value_string ndps_get_resman_session_type_enum[] = {
static int
align_4(tvbuff_t *tvb, int aoffset)
{
- if(tvb_length_remaining(tvb, aoffset) > 4 )
+ if(tvb_captured_length_remaining(tvb, aoffset) > 4 )
{
return (aoffset%4);
}
@@ -2331,7 +2331,7 @@ objectidentification(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
break;
case 3: /* Object Name */
foffset = ndps_string(tvb, hf_object_name, atree, foffset, NULL);
- if (foffset > tvb_length_remaining(tvb, foffset)) {
+ if (foffset > tvb_captured_length_remaining(tvb, foffset)) {
return foffset;
}
foffset = name_or_id(tvb, atree, foffset);
@@ -4223,7 +4223,7 @@ dissect_ndps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree)
ndps_packet_type = tvb_get_ntohl(tvb, 8);
if (ndps_packet_type != 0 && ndps_packet_type != 1) { /* Packet Type */
col_set_str(pinfo->cinfo, COL_INFO, "(Continuation Data)");
- proto_tree_add_text(ndps_tree, tvb, 0, tvb_length(tvb), "Data - (%d Bytes)", tvb_length(tvb));
+ proto_tree_add_text(ndps_tree, tvb, 0, tvb_captured_length(tvb), "Data - (%d Bytes)", tvb_captured_length(tvb));
return;
}
foffset = 0;
@@ -4342,7 +4342,7 @@ dissect_ndps_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
ndps_tree = proto_item_add_subtree(ti, ett_ndps);
dissect_ndps(tvb, pinfo, ndps_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -4425,7 +4425,7 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, spx_info *spx_i
*/
tid = (pinfo->srcport+pinfo->destport);
len = tvb_reported_length(tvb);
- if (tvb_length(tvb) >= len)
+ if (tvb_captured_length(tvb) >= len)
{
fd_head = fragment_add_seq_next(&ndps_reassembly_table, tvb, 0, pinfo, tid, NULL, len, !spx_info_p->eom);
if (fd_head != NULL)
@@ -4507,7 +4507,7 @@ static int
dissect_ndps_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, ndps_desegment, 4, get_ndps_pdu_len, dissect_ndps_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -4529,7 +4529,7 @@ dissect_ndps_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
ndps_tree = proto_item_add_subtree(ti, ett_ndps);
ndps_defrag(tvb, pinfo, ndps_tree, (spx_info*)data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -4713,7 +4713,7 @@ dissect_ndps_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, g
length = tvb_get_ntohl(tvb, foffset);
proto_tree_add_uint(btree, hf_ndps_included_doc_len, tvb, foffset, 4, length);
foffset += 4;
- length_remaining = tvb_length_remaining(tvb, foffset);
+ length_remaining = tvb_captured_length_remaining(tvb, foffset);
if (length_remaining == -1 || length > (guint32) length_remaining) /* Segmented Data */
{
proto_tree_add_item(btree, hf_ndps_data, tvb, foffset, -1, ENC_NA);
@@ -6457,7 +6457,7 @@ dissect_ndps_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, g
aitem = proto_tree_add_text(ndps_tree, tvb, foffset, -1, "Item %d", ii+1);
atree = proto_item_add_subtree(aitem, ett_ndps);
length=tvb_get_ntohl(tvb, foffset);
- length_remaining = tvb_length_remaining(tvb, foffset);
+ length_remaining = tvb_captured_length_remaining(tvb, foffset);
if(length_remaining == -1 || (guint32) length_remaining < length)
{
return foffset;
@@ -6820,7 +6820,7 @@ ndps_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int foffset
foffset += 4;
proto_tree_add_item(ndps_tree, hf_ndps_other_error_2, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (tvb_length_remaining(tvb, foffset) >= 4) {
+ if (tvb_captured_length_remaining(tvb, foffset) >= 4) {
foffset = ndps_string(tvb, hf_ndps_other_error_string, ndps_tree, foffset, NULL);
}
break;
@@ -7034,7 +7034,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
request_value->ndps_frame_num);
}
- if (tvb_length_remaining(tvb, foffset) < 12 && tvb_get_ntohl(tvb, foffset) == 0) /* No error and no return data */
+ if (tvb_captured_length_remaining(tvb, foffset) < 12 && tvb_get_ntohl(tvb, foffset) == 0) /* No error and no return data */
{
proto_tree_add_uint(ndps_tree, hf_ndps_error_val, tvb, foffset, 4, error_val);
col_append_str(pinfo->cinfo, COL_INFO, "- Ok");
@@ -7048,13 +7048,13 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
expert_add_info_format(pinfo, expert_item, &ei_ndps_rpc_acc_stat, "Fault: %s", val_to_str(expert_status, accept_stat, "Unknown NDPS Error (0x%08x)"));
}
foffset += 4;
- if (tvb_length_remaining(tvb,foffset) < 4 ) {
+ if (tvb_captured_length_remaining(tvb,foffset) < 4 ) {
col_append_str(pinfo->cinfo, COL_INFO, "- Error");
return foffset;
}
proto_tree_add_item(ndps_tree, hf_ndps_rpc_acc_results, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (tvb_length_remaining(tvb,foffset) < 4) {
+ if (tvb_captured_length_remaining(tvb,foffset) < 4) {
col_append_str(pinfo->cinfo, COL_INFO, "- Error");
return foffset;
}
@@ -7063,7 +7063,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
proto_tree_add_uint(ndps_tree, hf_ndps_error_val, tvb, foffset, 4, error_val);
foffset += 4;
/* Some functions return an error with no data, 0 is ok */
- if (try_val_to_str_ext(tvb_get_ntohl(tvb, foffset), &ndps_error_types_ext) && tvb_length_remaining(tvb,foffset) < 8 && (tvb_get_ntohl(tvb, foffset)!=0))
+ if (try_val_to_str_ext(tvb_get_ntohl(tvb, foffset), &ndps_error_types_ext) && tvb_captured_length_remaining(tvb,foffset) < 8 && (tvb_get_ntohl(tvb, foffset)!=0))
{
expert_status = tvb_get_ntohl(tvb, foffset);
expert_item = proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
@@ -7083,7 +7083,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
if(error_val != 0)
{
foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
- if(tvb_length_remaining(tvb, foffset) < 4)
+ if(tvb_captured_length_remaining(tvb, foffset) < 4)
{
break;
}
@@ -7101,7 +7101,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
if(error_val != 0)
{
foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
- if(tvb_length_remaining(tvb, foffset) < 4)
+ if(tvb_captured_length_remaining(tvb, foffset) < 4)
{
break;
}
@@ -7168,7 +7168,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Option %d", ii+1);
btree = proto_item_add_subtree(bitem, ett_ndps);
length=tvb_get_ntohl(tvb, foffset);
- length_remaining = tvb_length_remaining(tvb, foffset);
+ length_remaining = tvb_captured_length_remaining(tvb, foffset);
if(length_remaining == -1 || (guint32) length_remaining < length)
{
return foffset;
@@ -8328,7 +8328,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
bitem = proto_tree_add_text(atree, tvb, foffset, -1, "Item %d", ii+1);
btree = proto_item_add_subtree(bitem, ett_ndps);
length=tvb_get_ntohl(tvb, foffset);
- length_remaining = tvb_length_remaining(tvb, foffset);
+ length_remaining = tvb_captured_length_remaining(tvb, foffset);
if(length_remaining == -1 || (guint32) length_remaining < length)
{
return foffset;
diff --git a/epan/dissectors/packet-negoex.c b/epan/dissectors/packet-negoex.c
index 7c3f2cc76e..9ed88cc5eb 100644
--- a/epan/dissectors/packet-negoex.c
+++ b/epan/dissectors/packet-negoex.c
@@ -134,7 +134,7 @@ dissect_negoex_alert_message(tvbuff_t *tvb,
offset += 4;
/* The rest */
- proto_tree_add_text(tree, tvb, offset, tvb_length(tvb) - offset,
+ proto_tree_add_text(tree, tvb, offset, tvb_captured_length(tvb) - offset,
"The rest of the alert message");
}
@@ -366,7 +366,7 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
negoex_tree = NULL;
tf = NULL;
done = FALSE;
- payload_len = tvb_length(tvb);
+ payload_len = tvb_captured_length(tvb);
/* Set up the initial NEGOEX payload */
if (tree) {
@@ -461,7 +461,7 @@ dissect_negoex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
msg_tvb = tvb_new_subset(tvb,
start_offset,
- MIN(message_len, tvb_length(tvb)),
+ MIN(message_len, tvb_captured_length(tvb)),
message_len);
switch (message_type) {
diff --git a/epan/dissectors/packet-netanalyzer.c b/epan/dissectors/packet-netanalyzer.c
index 2821e3b7cf..ce39d376c1 100644
--- a/epan/dissectors/packet-netanalyzer.c
+++ b/epan/dissectors/packet-netanalyzer.c
@@ -249,7 +249,7 @@ dissect_netanalyzer_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (packet_status & MSK_ALIGN_ERR)
{
- proto_tree_add_text(netanalyzer_header_tree, tvb, tvb_length(tvb)-1, 1, "Displayed frame data contains additional nibble due to alignment error (upper nibble is not valid)");
+ proto_tree_add_text(netanalyzer_header_tree, tvb, tvb_captured_length(tvb)-1, 1, "Displayed frame data contains additional nibble due to alignment error (upper nibble is not valid)");
}
}
}
@@ -312,7 +312,7 @@ dissect_netanalyzer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *next_tvb;
proto_item *ti = NULL;
- if (tvb_length(tvb) >= 4)
+ if (tvb_captured_length(tvb) >= 4)
{
/* generate tvb subset for Ethernet frame */
if (dissect_netanalyzer_common(tvb, pinfo, tree))
@@ -325,7 +325,7 @@ dissect_netanalyzer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
/* something is wrong */
- ti = proto_tree_add_text(tree, tvb, 4, tvb_length(tvb)-4, "netANALYZER");
+ ti = proto_tree_add_text(tree, tvb, 4, tvb_captured_length(tvb)-4, "netANALYZER");
expert_add_info(pinfo, ti, &ei_netanalyzer_header_version_none);
}
}
@@ -339,7 +339,7 @@ dissect_netanalyzer_transparent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_tree *transparent_payload_tree = NULL;
tvbuff_t *next_tvb;
- if (tvb_length(tvb) >= 4)
+ if (tvb_captured_length(tvb) >= 4)
{
/* generate tvb subset for Ethernet frame */
if (dissect_netanalyzer_common(tvb, pinfo, tree))
@@ -348,7 +348,7 @@ dissect_netanalyzer_transparent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
* as normally the transparent mode is used for low level analysis
* where dissecting the frame's content wouldn't make much sense
* use data dissector instead */
- ti = proto_tree_add_text(tree, tvb, 4, tvb_length(tvb)-4, "Raw packet data");
+ ti = proto_tree_add_text(tree, tvb, 4, tvb_captured_length(tvb)-4, "Raw packet data");
transparent_payload_tree = proto_item_add_subtree(ti, ett_netanalyzer_transparent);
next_tvb = tvb_new_subset_remaining(tvb, 4);
call_dissector(data_dissector_handle, next_tvb, pinfo, transparent_payload_tree);
@@ -360,7 +360,7 @@ dissect_netanalyzer_transparent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
else
{
/* something is wrong */
- ti = proto_tree_add_text(tree, tvb, 4, tvb_length(tvb)-4, "netANALYZER transparent mode");
+ ti = proto_tree_add_text(tree, tvb, 4, tvb_captured_length(tvb)-4, "netANALYZER transparent mode");
expert_add_info(pinfo, ti, &ei_netanalyzer_header_version_none);
}
}
diff --git a/epan/dissectors/packet-netlink.c b/epan/dissectors/packet-netlink.c
index c6801aa1ba..75846469aa 100644
--- a/epan/dissectors/packet-netlink.c
+++ b/epan/dissectors/packet-netlink.c
@@ -125,7 +125,7 @@ dissect_netlink_attributes(tvbuff_t *tvb, header_field_info *hfi_type, int ett,
/* align to 4 */
offset = (offset + 3) & ~3;
- while (tvb_length_remaining(tvb, offset) >= 4) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 4) {
guint16 rta_len, rta_type;
int end_offset;
diff --git a/epan/dissectors/packet-netsync.c b/epan/dissectors/packet-netsync.c
index 8bde2c0941..c175ede065 100644
--- a/epan/dissectors/packet-netsync.c
+++ b/epan/dissectors/packet-netsync.c
@@ -442,7 +442,7 @@ dissect_netsync_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Netsync");
if (tree == NULL)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
while (tvb_reported_length_remaining(tvb, offset) > 0) {
ti = proto_tree_add_item(tree, proto_netsync, tvb, offset, -1, ENC_NA);
@@ -548,7 +548,7 @@ dissect_netsync_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
proto_item_set_len(netsync_tree, 1+1+size_bytes+size+4);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -556,7 +556,7 @@ dissect_netsync(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, netsync_desegment, 7, get_netsync_pdu_len,
dissect_netsync_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
index 7c682bf999..2edf334346 100644
--- a/epan/dissectors/packet-nfs.c
+++ b/epan/dissectors/packet-nfs.c
@@ -2331,7 +2331,7 @@ dissect_fhandle_data_CELERRA_VNX(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tr
static void
dissect_fhandle_data_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
- guint fhlen = tvb_length(tvb);
+ guint fhlen = tvb_captured_length(tvb);
proto_tree_add_item(tree, hf_nfs_fh_fhandle_data, tvb, 0, fhlen, ENC_NA);
}
@@ -2400,8 +2400,8 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
val_to_str_ext_const(default_nfs_fhandle_type, &names_fhtype_ext, "Unknown"));
real_length = fhlen;
- if (default_nfs_fhandle_type != FHT_UNKNOWN && real_length < tvb_length_remaining(tvb, offset))
- real_length = tvb_length_remaining(tvb, offset);
+ if (default_nfs_fhandle_type != FHT_UNKNOWN && real_length < tvb_captured_length_remaining(tvb, offset))
+ real_length = tvb_captured_length_remaining(tvb, offset);
fh_tvb = tvb_new_subset(tvb, offset, real_length, fhlen);
if (!dissector_try_uint(nfs_fhandle_table, default_nfs_fhandle_type, fh_tvb, pinfo, tree))
diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c
index 928c0d4f5f..624b80f3aa 100644
--- a/epan/dissectors/packet-nsip.c
+++ b/epan/dissectors/packet-nsip.c
@@ -642,7 +642,7 @@ decode_ie(nsip_ie_t *ie, build_info_t *bi) {
int org_offset = bi->offset;
- if (tvb_length_remaining(bi->tvb, bi->offset) < 1) {
+ if (tvb_captured_length_remaining(bi->tvb, bi->offset) < 1) {
return;
}
switch (ie->format) {
@@ -736,7 +736,7 @@ decode_pdu_ns_unitdata(build_info_t *bi) {
call_dissector(bssgp_handle, next_tvb, bi->pinfo, bi->parent_tree);
}
else {
- sdu_length = tvb_length_remaining(bi->tvb, bi->offset);
+ sdu_length = tvb_captured_length_remaining(bi->tvb, bi->offset);
proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, sdu_length,
"NS SDU (%u bytes)", sdu_length);
}
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index 1e7d154e31..ab1449eb26 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -1961,7 +1961,7 @@ dissect_ntlmssp_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
guint32 ntlm_seq_size = 4;
void *pd_save;
- length = tvb_length (tvb);
+ length = tvb_captured_length (tvb);
/* signature + seq + real payload */
encrypted_block_length = length - ntlm_magic_size;
@@ -2411,7 +2411,7 @@ dissect_ntlmssp_payload_only(tvbuff_t *tvb, packet_info *pinfo, _U_ proto_tree *
/* the magic ntlm is the identifier of a NTLMSSP packet that's 00 00 00 01
*/
- encrypted_block_length = tvb_length (tvb);
+ encrypted_block_length = tvb_captured_length (tvb);
/* signature + seq + real payload */
/* Setup a new tree for the NTLMSSP payload */
@@ -2470,7 +2470,7 @@ dissect_ntlmssp_verf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
guint32 encrypted_block_length;
void *pd_save;
- verifier_length = tvb_length (tvb);
+ verifier_length = tvb_captured_length (tvb);
encrypted_block_length = verifier_length - 4;
if (encrypted_block_length < 12) {
@@ -2559,7 +2559,7 @@ dissect_ntlmssp_encrypted_payload(tvbuff_t *data_tvb,
ntlmssp_info *conv_ntlmssp_info = NULL;
ntlmssp_packet_info *packet_ntlmssp_info;
- encrypted_block_length = tvb_length_remaining (data_tvb, offset);
+ encrypted_block_length = tvb_captured_length_remaining (data_tvb, offset);
fprintf(stderr, "Called dissect_ntlmssp_encrypted_payload\n");
/* Check to see if we already have state for this packet */
@@ -2689,7 +2689,7 @@ wrap_dissect_ntlmssp(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_ntlmssp(auth_tvb, pinfo, tree);
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
static int
diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c
index 9a4753b0ce..e6a34accdc 100644
--- a/epan/dissectors/packet-ntp.c
+++ b/epan/dissectors/packet-ntp.c
@@ -954,7 +954,7 @@ dissect_ntp_ext(tvbuff_t *tvb, proto_tree *ntp_tree, int offset)
*/
proto_tree_add_text(ntp_tree, tvb, offset+2, 2,
"Extension length %u < 8", extlen);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
if (extlen % 4) {
@@ -965,7 +965,7 @@ dissect_ntp_ext(tvbuff_t *tvb, proto_tree *ntp_tree, int offset)
proto_tree_add_text(ntp_tree, tvb, offset+2, 2,
"Extension length %u isn't a multiple of 4",
extlen);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
endoffset = offset + extlen;
diff --git a/epan/dissectors/packet-nwmtp.c b/epan/dissectors/packet-nwmtp.c
index 6a937e3f34..9a9ba801c1 100644
--- a/epan/dissectors/packet-nwmtp.c
+++ b/epan/dissectors/packet-nwmtp.c
@@ -106,7 +106,7 @@ static void dissect_nwmtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
next_tvb = tvb_new_subset_length(tvb, offset + 12, len);
- if (tvb_length(next_tvb) > 0)
+ if (tvb_captured_length(next_tvb) > 0)
call_dissector(mtp_handle, next_tvb, pinfo, tree);
/* Check for overflows, which probably can't happen, but better
* safe than sorry. See
diff --git a/epan/dissectors/packet-oicq.c b/epan/dissectors/packet-oicq.c
index d577cbdbb4..b8f1d05d29 100644
--- a/epan/dissectors/packet-oicq.c
+++ b/epan/dissectors/packet-oicq.c
@@ -157,7 +157,7 @@ dissect_oicq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-olsr.c b/epan/dissectors/packet-olsr.c
index 2775933869..63968b81e4 100644
--- a/epan/dissectors/packet-olsr.c
+++ b/epan/dissectors/packet-olsr.c
@@ -538,13 +538,13 @@ static int dissect_olsr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
guint16 packet_len;
/* Does this packet have a valid message type at the beginning? */
- if (tvb_length(tvb) < 4) {
+ if (tvb_captured_length(tvb) < 4) {
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR Packet, Length: %u Bytes (not enough data in packet)",
- tvb_length(tvb));
+ tvb_captured_length(tvb));
return 0; /* not enough bytes for the packet length */
}
packet_len = tvb_get_ntohs(tvb, 0);
- if (packet_len > tvb_length(tvb)) {
+ if (packet_len > tvb_captured_length(tvb)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR Packet, Length: %u Bytes (not enough data in packet)", packet_len);
return 0;
}
@@ -678,7 +678,7 @@ static int dissect_olsr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
offset = message_end;
} /* end while for message alive */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* end Dissecting */
/*-----------Register the Dissector for OLSR--------------*/
diff --git a/epan/dissectors/packet-omron-fins.c b/epan/dissectors/packet-omron-fins.c
index 3519df28ed..28518363eb 100644
--- a/epan/dissectors/packet-omron-fins.c
+++ b/epan/dissectors/packet-omron-fins.c
@@ -1103,7 +1103,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
guint16 command_code;
/* Make sure we have enough actual data to do the heuristics checks */
- if(tvb_length(tvb) < 12 ) {
+ if(tvb_captured_length(tvb) < 12 ) {
return 0;
}
/* Check some bytes to see if it's OMRON */
@@ -1195,7 +1195,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
if (cmd_str_idx == -1) {
/* Unknown command-code */
expert_add_info(pinfo, ti, &ei_omron_command_code);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Handle special cases wherein the data length for a command and/or a response can be 0 */
@@ -1215,7 +1215,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
if (reported_length_remaining != 0) {
expert_add_info_format(pinfo, omron_tree, &ei_omron_bad_length, "Unexpected Length (Should be 0)");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
break;
@@ -1231,14 +1231,14 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
{
expert_add_info_format(pinfo, ti, &ei_omron_command_code, "Unknown Response Command-Code");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
break;
case 0x0801:
/* command data length = 0 or > 0 is OK; */
if (is_command) {
if (reported_length_remaining == 0)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
break;
@@ -1246,13 +1246,13 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
/* command data length = 0 or > 0 is OK; */
if (is_command) {
if (reported_length_remaining == 0)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* There's no response */
if (is_response)
{
expert_add_info_format(pinfo, ti, &ei_omron_command_code, "Unknown Response Command-Code");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
break;
@@ -1482,7 +1482,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
if(memory_code_len == 0) {
expert_add_info_format(pinfo, ti, &ei_oomron_command_memory_area_code, "Unknown Memory-Area-Code (%u)", memory_area_code);
- return tvb_length(tvb); /* Bail out .... */
+ return tvb_captured_length(tvb); /* Bail out .... */
}
proto_tree_add_item(command_tree, hf_omron_data, tvb, offset, memory_code_len, ENC_NA);
offset = offset + memory_code_len;
@@ -3242,7 +3242,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
} /* if(tree) */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c
index 4b2d14943f..119a944c8d 100644
--- a/epan/dissectors/packet-opensafety.c
+++ b/epan/dissectors/packet-opensafety.c
@@ -1010,7 +1010,7 @@ static void dissect_ssdo_payload ( packet_info *pinfo, tvbuff_t *new_tvb, proto_
proto_item *item;
proto_tree *sod_tree, *ext_tree;
- dataLength = tvb_length(new_tvb);
+ dataLength = tvb_captured_length(new_tvb);
ssdoIndex = tvb_get_letohs(new_tvb, 0);
@@ -2006,7 +2006,7 @@ opensafety_package_dissector(const gchar *protocolName, const gchar *sub_diss_ha
next_tvb = NULL;
/* Smallest possible frame size is 11 */
- if ( tvb_length_remaining(message_tvb, frameOffset ) < OSS_MINIMUM_LENGTH )
+ if ( tvb_captured_length_remaining(message_tvb, frameOffset ) < OSS_MINIMUM_LENGTH )
break;
/* Finding the start of the first possible safety frame */
@@ -2352,7 +2352,7 @@ dissect_opensafety_udpdata(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree
return result;
/* An openSAFETY frame has at least OSS_MINIMUM_LENGTH bytes */
- if ( tvb_length ( message_tvb ) < OSS_MINIMUM_LENGTH )
+ if ( tvb_captured_length ( message_tvb ) < OSS_MINIMUM_LENGTH )
return result;
/* More than one openSAFETY package could be transported in the same frame,
diff --git a/epan/dissectors/packet-openvpn.c b/epan/dissectors/packet-openvpn.c
index c8268ef1c2..83f975ab82 100644
--- a/epan/dissectors/packet-openvpn.c
+++ b/epan/dissectors/packet-openvpn.c
@@ -247,7 +247,7 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
proto_tree_add_item(openvpn_tree, hf_openvpn_hmac, tvb, offset, tls_auth_hmac_size, ENC_NA);
offset += tls_auth_hmac_size;
- if (tvb_length_remaining(tvb, offset) >= 8) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 8) {
proto_tree_add_item(openvpn_tree, hf_openvpn_pid, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
@@ -258,7 +258,7 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
}
}
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 1) {
/* read P_ACK packet-id array length */
gint pid_arraylength = tvb_get_guint8(tvb, offset);
gint i;
@@ -274,7 +274,7 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
offset += 4;
}
- if (tvb_length_remaining(tvb, offset) >= 8) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 8) {
proto_tree_add_item(openvpn_tree, hf_openvpn_rsessionid, tvb, offset, 8, ENC_BIG_ENDIAN);
offset += 8;
}
@@ -284,7 +284,7 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
/* if we have a P_CONTROL packet */
if (openvpn_opcode != P_ACK_V1) {
/* read Message Packet-ID */
- if (tvb_length_remaining(tvb, offset) >= 4) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 4) {
msg_mpid = tvb_get_bits32(tvb, offset*8, 32, ENC_BIG_ENDIAN);
proto_tree_add_item(openvpn_tree, hf_openvpn_mpid, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
@@ -293,20 +293,20 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
}
/* if we have more data left, determine what to do */
- msg_length_remaining = tvb_length_remaining(tvb, offset);
+ msg_length_remaining = tvb_captured_length_remaining(tvb, offset);
if (msg_length_remaining == 0) {
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if (openvpn_opcode != P_CONTROL_V1) {
proto_tree *data_tree;
ti2 = proto_tree_add_text(openvpn_tree, tvb, offset, -1, "Data (%d bytes)",
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
data_tree = proto_item_add_subtree(ti2, ett_openvpn_data);
proto_tree_add_item(data_tree, hf_openvpn_data, tvb, offset, -1, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Try to reassemble */
@@ -341,7 +341,7 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
if ((frag_msg == NULL) || (frag_msg->next != NULL)) {
proto_tree *data_tree;
ti2 = proto_tree_add_text(openvpn_tree, tvb, offset, -1, "Message fragment (%d bytes)",
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
data_tree = proto_item_add_subtree(ti2, ett_openvpn_data);
proto_tree_add_item(data_tree, hf_openvpn_fragment_bytes, tvb, offset, -1, ENC_NA);
@@ -376,7 +376,7 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
call_dissector(ssl_handle, new_tvb, pinfo, parent_tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -409,7 +409,7 @@ dissect_openvpn_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
since the length is the first thing in an openvpn packet we choose 2 */
get_msg_length, /* fptr for function to get the packetlength of current frame */
dissect_openvpn_msg_tcp, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
diff --git a/epan/dissectors/packet-openwire.c b/epan/dissectors/packet-openwire.c
index 3d76fa8bbc..40d44443c5 100644
--- a/epan/dissectors/packet-openwire.c
+++ b/epan/dissectors/packet-openwire.c
@@ -578,7 +578,7 @@ detect_protocol_options(tvbuff_t *tvb, packet_info *pinfo, int offset, int iComm
However, if the capture is started after the connection initial handshake, it must be deduced in a heuristic way.
For the sake of generality, we do not consider the handshake, but only the heuristic way.
*/
- if (tvb_length_remaining(tvb, offset) >= 12)
+ if (tvb_captured_length_remaining(tvb, offset) >= 12)
{
/* Only check commands which start with a "OPENWIRE_TYPE_CACHED" object */
if (iCommand == OPENWIRE_SESSION_INFO
@@ -631,7 +631,7 @@ detect_protocol_options(tvbuff_t *tvb, packet_info *pinfo, int offset, int iComm
}
}
else if ((tvb_get_guint8(tvb, 4) == OPENWIRE_KEEP_ALIVE_INFO)
- && (tvb_length(tvb) == 11))
+ && (tvb_captured_length(tvb) == 11))
{
/* If the capture is started after a long-lived connection is started,
a keep-alive command of 11 bytes detects tight encoding (not caching stays unknown).
@@ -685,7 +685,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
proto_item *boolean_item = NULL;
const char *cache_str = "";
- if (type == OPENWIRE_TYPE_CACHED && retrieve_caching(pinfo) == TRUE && tvb_length_remaining(tvb, offset) >= 3)
+ if (type == OPENWIRE_TYPE_CACHED && retrieve_caching(pinfo) == TRUE && tvb_captured_length_remaining(tvb, offset) >= 3)
{
guint8 inlined = 0;
gint cachedID = 0;
@@ -715,7 +715,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
offset += 3;
}
}
- if (nullable == TRUE && (type == OPENWIRE_TYPE_NESTED || type == OPENWIRE_TYPE_CACHED || type == OPENWIRE_COMMAND_INNER) && tvb_length_remaining(tvb, offset) >= 1)
+ if (nullable == TRUE && (type == OPENWIRE_TYPE_NESTED || type == OPENWIRE_TYPE_CACHED || type == OPENWIRE_COMMAND_INNER) && tvb_captured_length_remaining(tvb, offset) >= 1)
{
nullable = tvb_get_guint8(tvb, offset + 0) == FALSE ? TRUE : FALSE;
if (openwire_verbose_type)
@@ -730,7 +730,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
}
offset += 1;
}
- if (type == OPENWIRE_COMMAND_INNER && tvb_length_remaining(tvb, offset) >= 1)
+ if (type == OPENWIRE_COMMAND_INNER && tvb_captured_length_remaining(tvb, offset) >= 1)
{
proto_item * inner_item = NULL;
proto_tree * object_tree = NULL;
@@ -741,7 +741,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
object_tree = proto_item_add_subtree(inner_item, ett_openwire_type);
return (1 + dissect_openwire_command(tvb, pinfo, object_tree, offset, parentType));
}
- if ((type == OPENWIRE_TYPE_NESTED || type == OPENWIRE_TYPE_CACHED) && tvb_length_remaining(tvb, offset) >= 1)
+ if ((type == OPENWIRE_TYPE_NESTED || type == OPENWIRE_TYPE_CACHED) && tvb_captured_length_remaining(tvb, offset) >= 1)
{
type = tvb_get_guint8(tvb, offset + 0);
if (openwire_verbose_type)
@@ -750,7 +750,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
}
offset += 1;
}
- if (nullable == TRUE && tvb_length_remaining(tvb, offset) >= 1)
+ if (nullable == TRUE && tvb_captured_length_remaining(tvb, offset) >= 1)
{
nullable = tvb_get_guint8(tvb, offset + 0) == FALSE ? TRUE : FALSE;
if (openwire_verbose_type)
@@ -771,48 +771,48 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
{
offset += 0;
}
- else if (type == OPENWIRE_TYPE_INTEGER && tvb_length_remaining(tvb, offset) >= 4)
+ else if (type == OPENWIRE_TYPE_INTEGER && tvb_captured_length_remaining(tvb, offset) >= 4)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_integer), tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
- else if (type == OPENWIRE_TYPE_SHORT && tvb_length_remaining(tvb, offset) >= 2)
+ else if (type == OPENWIRE_TYPE_SHORT && tvb_captured_length_remaining(tvb, offset) >= 2)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_short), tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
- else if (type == OPENWIRE_TYPE_LONG && tvb_length_remaining(tvb, offset) >= 8)
+ else if (type == OPENWIRE_TYPE_LONG && tvb_captured_length_remaining(tvb, offset) >= 8)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_long), tvb, offset, 8, ENC_BIG_ENDIAN);
offset += 8;
}
- else if (type == OPENWIRE_TYPE_BOOLEAN && tvb_length_remaining(tvb, offset) >= 1)
+ else if (type == OPENWIRE_TYPE_BOOLEAN && tvb_captured_length_remaining(tvb, offset) >= 1)
{
boolean_item = proto_tree_add_item(tree, particularize(field, hf_openwire_type_boolean), tvb, offset, 1, ENC_BIG_ENDIAN);
validate_boolean(tvb, pinfo, tree, offset, boolean_item);
offset += 1;
}
- else if (type == OPENWIRE_TYPE_BYTE && tvb_length_remaining(tvb, offset) >= 1)
+ else if (type == OPENWIRE_TYPE_BYTE && tvb_captured_length_remaining(tvb, offset) >= 1)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_byte), tvb, offset, 1, ENC_NA);
offset += 1;
}
- else if (type == OPENWIRE_TYPE_CHAR && tvb_length_remaining(tvb, offset) >= 2)
+ else if (type == OPENWIRE_TYPE_CHAR && tvb_captured_length_remaining(tvb, offset) >= 2)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_char), tvb, offset, 2, ENC_NA);
offset += 2;
}
- else if (type == OPENWIRE_TYPE_FLOAT && tvb_length_remaining(tvb, offset) >= 4)
+ else if (type == OPENWIRE_TYPE_FLOAT && tvb_captured_length_remaining(tvb, offset) >= 4)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_float), tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
- else if (type == OPENWIRE_TYPE_DOUBLE && tvb_length_remaining(tvb, offset) >= 8)
+ else if (type == OPENWIRE_TYPE_DOUBLE && tvb_captured_length_remaining(tvb, offset) >= 8)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_double), tvb, offset, 8, ENC_BIG_ENDIAN);
offset += 8;
}
- else if (type == OPENWIRE_TYPE_STRING && tvb_length_remaining(tvb, offset) >= 2)
+ else if (type == OPENWIRE_TYPE_STRING && tvb_captured_length_remaining(tvb, offset) >= 2)
{
gint iStringLength = 0;
iStringLength = tvb_get_ntohs(tvb, offset);
@@ -821,13 +821,13 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
proto_tree_add_item(tree, hf_openwire_type_short, tvb, offset, 2, ENC_BIG_ENDIAN);
}
offset += 2;
- if (tvb_length_remaining(tvb, offset) >= iStringLength)
+ if (tvb_captured_length_remaining(tvb, offset) >= iStringLength)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_string), tvb, offset, iStringLength, ENC_NA);
offset += iStringLength;
}
}
- else if (type == OPENWIRE_TYPE_BIG_STRING && tvb_length_remaining(tvb, offset) >= 4)
+ else if (type == OPENWIRE_TYPE_BIG_STRING && tvb_captured_length_remaining(tvb, offset) >= 4)
{
gint iStringLength = 0;
iStringLength = tvb_get_ntohl(tvb, offset);
@@ -836,13 +836,13 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
proto_tree_add_item(tree, hf_openwire_type_integer, tvb, offset, 4, ENC_BIG_ENDIAN);
}
offset += 4;
- if (tvb_length_remaining(tvb, offset) >= iStringLength)
+ if (tvb_captured_length_remaining(tvb, offset) >= iStringLength)
{
proto_tree_add_item(tree, particularize(field, hf_openwire_type_string), tvb, offset, iStringLength, ENC_NA);
offset += iStringLength;
}
}
- else if (type == OPENWIRE_TYPE_BYTE_ARRAY && tvb_length_remaining(tvb, offset) >= 4)
+ else if (type == OPENWIRE_TYPE_BYTE_ARRAY && tvb_captured_length_remaining(tvb, offset) >= 4)
{
gint iArrayLength = 0;
iArrayLength = tvb_get_ntohl(tvb, offset);
@@ -851,7 +851,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
proto_tree_add_item(tree, hf_openwire_type_integer, tvb, offset, 4, ENC_BIG_ENDIAN);
}
offset += 4;
- if (tvb_length_remaining(tvb, offset) >= iArrayLength)
+ if (tvb_captured_length_remaining(tvb, offset) >= iArrayLength)
{
proto_item * array_item = NULL;
proto_tree * object_tree = NULL;
@@ -894,7 +894,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
offset += iArrayLength;
}
}
- else if (tvb_length_remaining(tvb, offset) >= 1)
+ else if (tvb_captured_length_remaining(tvb, offset) >= 1)
{
/* Check for complex types */
proto_tree *object_tree;
@@ -905,7 +905,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
object_tree = proto_item_add_subtree(ti, ett_openwire_type);
- if (type == OPENWIRE_TYPE_OBJECT_ARRAY && tvb_length_remaining(tvb, offset) >= 2)
+ if (type == OPENWIRE_TYPE_OBJECT_ARRAY && tvb_captured_length_remaining(tvb, offset) >= 2)
{
gint iArrayLength;
int iArrayItem = 0;
@@ -918,13 +918,13 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
offset += 2;
for (iArrayItem = 0; iArrayItem < iArrayLength; iArrayItem++)
{
- if (tvb_length_remaining(tvb, offset) >= 0)
+ if (tvb_captured_length_remaining(tvb, offset) >= 0)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_none, OPENWIRE_TYPE_NESTED, type, TRUE);
}
}
}
- else if (type == OPENWIRE_TYPE_MAP && tvb_length_remaining(tvb, offset) >= 4)
+ else if (type == OPENWIRE_TYPE_MAP && tvb_captured_length_remaining(tvb, offset) >= 4)
{
int iMapItem = 0;
int iMapLength = 0;
@@ -935,7 +935,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
}
proto_item_append_text(ti, " (Size : %d)", iMapLength);
offset += 4;
- for (iMapItem = 0; (iMapItem < iMapLength) && (tvb_length_remaining(tvb, offset) > 0); iMapItem++)
+ for (iMapItem = 0; (iMapItem < iMapLength) && (tvb_captured_length_remaining(tvb, offset) > 0); iMapItem++)
{
proto_item * map_entry;
proto_tree * entry_tree;
@@ -951,7 +951,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
proto_item_set_len(map_entry, offset - entryStartOffset);
}
}
- else if (type == OPENWIRE_TYPE_THROWABLE && tvb_length_remaining(tvb, offset) >= 2)
+ else if (type == OPENWIRE_TYPE_THROWABLE && tvb_captured_length_remaining(tvb, offset) >= 2)
{
gint iStackTraceDepth, iStackTraceItem;
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_throwable_class, OPENWIRE_TYPE_STRING, type, TRUE);
@@ -972,7 +972,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
element = proto_tree_add_item(object_tree, hf_openwire_throwable_element, tvb, startElementOffset, -1, ENC_NA);
element_tree = proto_item_add_subtree(element, ett_openwire_type);
- if (tvb_length_remaining(tvb, offset) >= 0)
+ if (tvb_captured_length_remaining(tvb, offset) >= 0)
{
offset += dissect_openwire_type(tvb, pinfo, element_tree, offset, hf_openwire_throwable_classname, OPENWIRE_TYPE_STRING, type, TRUE);
offset += dissect_openwire_type(tvb, pinfo, element_tree, offset, hf_openwire_throwable_methodname, OPENWIRE_TYPE_STRING, type, TRUE);
@@ -984,47 +984,47 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_exceptionresponse_exception, OPENWIRE_TYPE_THROWABLE, type, TRUE);
}
}
- else if (type == OPENWIRE_TYPE_LIST && tvb_length_remaining(tvb, offset) >= 4)
+ else if (type == OPENWIRE_TYPE_LIST && tvb_captured_length_remaining(tvb, offset) >= 4)
{
/* TODO (unused) */
}
- else if (type == OPENWIRE_CONNECTION_ID && tvb_length_remaining(tvb, offset) >= 1)
+ else if (type == OPENWIRE_CONNECTION_ID && tvb_captured_length_remaining(tvb, offset) >= 1)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_connectionid_value, OPENWIRE_TYPE_STRING, type, TRUE);
}
- else if (type == OPENWIRE_SESSION_ID && tvb_length_remaining(tvb, offset) >= 2)
+ else if (type == OPENWIRE_SESSION_ID && tvb_captured_length_remaining(tvb, offset) >= 2)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_sessionid_connectionid, OPENWIRE_TYPE_STRING, type, TRUE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_sessionid_value, OPENWIRE_TYPE_LONG, type, FALSE);
}
- else if (type == OPENWIRE_CONSUMER_ID && tvb_length_remaining(tvb, offset) >= 3)
+ else if (type == OPENWIRE_CONSUMER_ID && tvb_captured_length_remaining(tvb, offset) >= 3)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_consumerid_connectionid, OPENWIRE_TYPE_STRING, type, TRUE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_consumerid_value, OPENWIRE_TYPE_LONG, type, FALSE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_consumerid_sessionid, OPENWIRE_TYPE_LONG, type, FALSE);
}
- else if (type == OPENWIRE_PRODUCER_ID && tvb_length_remaining(tvb, offset) >= 3)
+ else if (type == OPENWIRE_PRODUCER_ID && tvb_captured_length_remaining(tvb, offset) >= 3)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_producerid_connectionid, OPENWIRE_TYPE_STRING, type, TRUE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_producerid_value, OPENWIRE_TYPE_LONG, type, FALSE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_producerid_sessionid, OPENWIRE_TYPE_LONG, type, FALSE);
}
- else if (type == OPENWIRE_BROKER_ID && tvb_length_remaining(tvb, offset) >= 1)
+ else if (type == OPENWIRE_BROKER_ID && tvb_captured_length_remaining(tvb, offset) >= 1)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_brokerid_value, OPENWIRE_TYPE_STRING, type, TRUE);
}
- else if (type == OPENWIRE_MESSAGE_ID && tvb_length_remaining(tvb, offset) >= 3)
+ else if (type == OPENWIRE_MESSAGE_ID && tvb_captured_length_remaining(tvb, offset) >= 3)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_messageid_producerid, OPENWIRE_TYPE_CACHED, type, TRUE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_messageid_producersequenceid, OPENWIRE_TYPE_LONG, type, FALSE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_messageid_brokersequenceid, OPENWIRE_TYPE_LONG, type, FALSE);
}
- else if (type == OPENWIRE_ACTIVEMQ_LOCAL_TRANSACTION_ID && tvb_length_remaining(tvb, offset) >= 2)
+ else if (type == OPENWIRE_ACTIVEMQ_LOCAL_TRANSACTION_ID && tvb_captured_length_remaining(tvb, offset) >= 2)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_localtransactionid_value, OPENWIRE_TYPE_LONG, type, FALSE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_localtransactionid_connectionid, OPENWIRE_TYPE_CACHED, type, TRUE);
}
- else if (type == OPENWIRE_ACTIVEMQ_XA_TRANSACTION_ID && tvb_length_remaining(tvb, offset) >= 3)
+ else if (type == OPENWIRE_ACTIVEMQ_XA_TRANSACTION_ID && tvb_captured_length_remaining(tvb, offset) >= 3)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_xatransactionid_formatid, OPENWIRE_TYPE_INTEGER, type, FALSE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_xatransactionid_globaltransactionid, OPENWIRE_TYPE_BYTE_ARRAY, type, TRUE);
@@ -1034,7 +1034,7 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
|| type == OPENWIRE_ACTIVEMQ_TOPIC
|| type == OPENWIRE_ACTIVEMQ_TEMP_QUEUE
|| type == OPENWIRE_ACTIVEMQ_TEMP_TOPIC)
- && tvb_length_remaining(tvb, offset) >= 1)
+ && tvb_captured_length_remaining(tvb, offset) >= 1)
{
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_destination_name, OPENWIRE_TYPE_STRING, type, TRUE);
}
@@ -1081,10 +1081,10 @@ dissect_openwire_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_message_brokerintime, OPENWIRE_TYPE_LONG, type, FALSE);
offset += dissect_openwire_type(tvb, pinfo, object_tree, offset, hf_openwire_message_brokerouttime, OPENWIRE_TYPE_LONG, type, FALSE);
}
- else if (tvb_length_remaining(tvb, offset) > 0)
+ else if (tvb_captured_length_remaining(tvb, offset) > 0)
{
expert_add_info_format(pinfo, object_tree, &ei_openwire_type_not_supported, "OpenWire type not supported by Wireshark : %d", type);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
proto_item_set_len(ti, offset - startOffset);
@@ -1105,7 +1105,7 @@ dissect_openwire_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
if (iCommand == OPENWIRE_WIREFORMAT_INFO)
{
- if (tvb_length_remaining(tvb, offset) >= 17)
+ if (tvb_captured_length_remaining(tvb, offset) >= 17)
{
proto_tree_add_item(tree, hf_openwire_wireformatinfo_magic, tvb, offset + 0, 8, ENC_ASCII|ENC_NA);
proto_tree_add_item(tree, hf_openwire_wireformatinfo_version, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
@@ -1117,7 +1117,7 @@ dissect_openwire_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
}
else
{
- if (tvb_length_remaining(tvb, offset) >= 5)
+ if (tvb_captured_length_remaining(tvb, offset) >= 5)
{
proto_tree_add_item(tree, hf_openwire_command_id, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_openwire_command_response_required, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
@@ -1221,7 +1221,7 @@ dissect_openwire_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
guint8 iTransactionType;
offset += dissect_openwire_type(tvb, pinfo, tree, offset, hf_openwire_transactioninfo_connectionid, OPENWIRE_TYPE_CACHED, iCommand, TRUE);
offset += dissect_openwire_type(tvb, pinfo, tree, offset, hf_openwire_transactioninfo_transactionid, OPENWIRE_TYPE_CACHED, iCommand, TRUE);
- if (tvb_length_remaining(tvb, offset) >= 1)
+ if (tvb_captured_length_remaining(tvb, offset) >= 1)
{
iTransactionType = tvb_get_guint8(tvb, offset);
offset += dissect_openwire_type(tvb, pinfo, tree, offset, hf_openwire_transactioninfo_type, OPENWIRE_TYPE_BYTE, iCommand, FALSE);
@@ -1302,7 +1302,7 @@ dissect_openwire_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
{
offset += dissect_openwire_type(tvb, pinfo, tree, offset, hf_openwire_none, iCommand, parentType, FALSE);
}
- else if (tvb_length_remaining(tvb, offset) > 0)
+ else if (tvb_captured_length_remaining(tvb, offset) > 0)
{
expert_add_info_format(pinfo, tree, &ei_openwire_command_not_supported, "OpenWire command not supported by Wireshark: %d", iCommand);
}
@@ -1319,7 +1319,7 @@ dissect_openwire(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
col_set_str(pinfo->cinfo, COL_PROTOCOL, "OpenWire");
col_clear(pinfo->cinfo, COL_INFO);
- if (tvb_length_remaining(tvb, offset) >= 5)
+ if (tvb_captured_length_remaining(tvb, offset) >= 5)
{
guint8 iCommand;
proto_tree *openwireroot_tree;
@@ -1345,7 +1345,7 @@ dissect_openwire(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
{
proto_tree_add_item(openwireroot_tree, hf_openwire_command, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
expert_add_info(pinfo, openwireroot_tree, &ei_openwire_tight_encoding_not_supported);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
caching = retrieve_caching(pinfo);
@@ -1356,19 +1356,19 @@ dissect_openwire(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
offset += 4;
offset += dissect_openwire_command(tvb, pinfo, openwireroot_tree, offset, iCommand);
- if (tvb_length_remaining(tvb, offset) > 0)
+ if (tvb_captured_length_remaining(tvb, offset) > 0)
{
expert_add_info_format(pinfo, tree, &ei_openwire_command_not_supported, "OpenWire command fields unknown to Wireshark: %d", iCommand);
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
get_openwire_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
- if (tvb_length_remaining(tvb, offset) >= 5)
+ if (tvb_captured_length_remaining(tvb, offset) >= 5)
{
return (tvb_get_ntohl(tvb, offset) + 4);
}
@@ -1379,7 +1379,7 @@ static int
dissect_openwire_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, openwire_desegment, 5, get_openwire_pdu_len, dissect_openwire, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1389,25 +1389,25 @@ dissect_openwire_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
conversation_t *conversation;
gboolean detected = FALSE;
- if (tvb_length(tvb) == 10 || tvb_length(tvb) == 11)
+ if (tvb_captured_length(tvb) == 10 || tvb_captured_length(tvb) == 11)
{
/* KeepAlive is sent by default every 30 second. It is 10 bytes (loose) or 11 bytes (tight) long. */
if ((tvb_get_guint8(tvb, 4) == OPENWIRE_KEEP_ALIVE_INFO)
- && (tvb_get_ntohl(tvb, 0) + 4 == tvb_length(tvb)))
+ && (tvb_get_ntohl(tvb, 0) + 4 == tvb_captured_length(tvb)))
{
detected = TRUE;
}
}
- else if (tvb_length(tvb) == 14 || tvb_length(tvb) == 15)
+ else if (tvb_captured_length(tvb) == 14 || tvb_captured_length(tvb) == 15)
{
/* Response is sent after several commands. It is 14 bytes (loose) or 15 bytes (tight) long. */
if ((tvb_get_guint8(tvb, 4) == OPENWIRE_RESPONSE)
- && (tvb_get_ntohl(tvb, 0) + 4 == tvb_length(tvb)))
+ && (tvb_get_ntohl(tvb, 0) + 4 == tvb_captured_length(tvb)))
{
detected = TRUE;
}
}
- else if (tvb_length(tvb) >= 13)
+ else if (tvb_captured_length(tvb) >= 13)
{
/* Only the WIREFORMAT_INFO command contains a "magic". It is the first command sent on a connection.
If the capture was started after this command, a manual "Decode As..." might be required.
diff --git a/epan/dissectors/packet-opsi.c b/epan/dissectors/packet-opsi.c
index 848f67a03c..499694e720 100644
--- a/epan/dissectors/packet-opsi.c
+++ b/epan/dissectors/packet-opsi.c
@@ -582,7 +582,7 @@ dissect_opsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
dissect_attributes(tvb, pinfo, opsi_tree, HEADER_LENGTH, MIN(((int)tvb_reported_length(tvb)-HEADER_LENGTH), (tvb_get_ntohs(tvb, PACKET_LENGTH_OFFSET)-HEADER_LENGTH)));
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -592,7 +592,7 @@ dissect_opsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
/* We should mimimally grab the header */
tcp_dissect_pdus(tvb, pinfo, tree, opsi_desegment, HEADER_LENGTH, get_opsi_pdu_len,
dissect_opsi_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-osi.c b/epan/dissectors/packet-osi.c
index ca825aa744..38a8efde28 100644
--- a/epan/dissectors/packet-osi.c
+++ b/epan/dissectors/packet-osi.c
@@ -64,7 +64,7 @@ calc_checksum( tvbuff_t *tvb, int offset, guint len, guint checksum) {
if ( 0 == checksum )
return( NO_CKSUM );
- available_len = tvb_length_remaining( tvb, offset );
+ available_len = tvb_captured_length_remaining( tvb, offset );
if ( available_len < len )
return( DATA_MISSING );
@@ -119,7 +119,7 @@ check_and_get_checksum( tvbuff_t *tvb, int offset, guint len, guint checksum, in
if ( 0 == checksum )
return( NO_CKSUM );
- available_len = tvb_length_remaining( tvb, offset );
+ available_len = tvb_captured_length_remaining( tvb, offset );
offset_check -= offset;
if ( ( available_len < len ) || ( offset_check < 0 ) || ( (guint)(offset_check+2) > len ) )
return( DATA_MISSING );
diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c
index b286bf26e6..b9aca85360 100644
--- a/epan/dissectors/packet-ositp.c
+++ b/epan/dissectors/packet-ositp.c
@@ -925,7 +925,7 @@ static int ositp_decode_DR(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
/* User data */
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
/* we dissected all of the containing PDU */
return offset;
@@ -1181,7 +1181,7 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
offset += li;
next_tvb = tvb_new_subset_remaining(tvb, offset);
- fragment_length = tvb_length(next_tvb);
+ fragment_length = tvb_captured_length(next_tvb);
if (fragment) {
col_append_fstr(pinfo->cinfo, COL_INFO, " [COTP fragment, %u byte%s]",
fragment_length, plurality(fragment_length, "", "s"));
@@ -1253,7 +1253,7 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
}
}
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
/* we dissected all of the containing PDU */
return offset;
@@ -1455,7 +1455,7 @@ static int ositp_decode_ED(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
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);
/* we dissected all of the containing PDU */
return offset;
@@ -1665,7 +1665,7 @@ static int ositp_decode_CC(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
}
else
call_dissector(data_handle, next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
/* we dissected all of the containing PDU */
return offset;
@@ -2147,7 +2147,7 @@ static int ositp_decode_UD(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
/*call_dissector(data_handle,next_tvb, pinfo, tree); */
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
/* we dissected all of the containing PDU */
return offset;
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c
index 0c9edb8d42..a18f920065 100644
--- a/epan/dissectors/packet-ospf.c
+++ b/epan/dissectors/packet-ospf.c
@@ -1241,7 +1241,7 @@ dissect_ospf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return;
}
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
/* XXX - include only the length from the OSPF header? */
reported_length = tvb_reported_length(tvb);
if (cksum !=0 && !pinfo->fragmented && length >= reported_length
diff --git a/epan/dissectors/packet-p1.c b/epan/dissectors/packet-p1.c
index 2dec852ecd..76ae3b71bd 100644
--- a/epan/dissectors/packet-p1.c
+++ b/epan/dissectors/packet-p1.c
@@ -922,7 +922,7 @@ static void do_address(const char* addr, tvbuff_t* tvb_string, asn1_ctx_t* actx)
wmem_strbuf_append(ctx->oraddress, addr);
}
if (tvb_string) {
- wmem_strbuf_append(ctx->oraddress, tvb_format_text(tvb_string, 0, tvb_length(tvb_string)));
+ wmem_strbuf_append(ctx->oraddress, tvb_format_text(tvb_string, 0, tvb_captured_length(tvb_string)));
}
}
@@ -936,7 +936,7 @@ static void do_address_str(const char* addr, tvbuff_t* tvb_string, asn1_ctx_t* a
do_address(addr, tvb_string, actx);
if (ctx && ctx->do_address && ddatype && tvb_string)
- wmem_strbuf_append(ddatype, tvb_format_text(tvb_string, 0, tvb_length(tvb_string)));
+ wmem_strbuf_append(ddatype, tvb_format_text(tvb_string, 0, tvb_captured_length(tvb_string)));
}
static void do_address_str_tree(const char* addr, tvbuff_t* tvb_string, asn1_ctx_t* actx, proto_tree* tree)
@@ -948,7 +948,7 @@ static void do_address_str_tree(const char* addr, tvbuff_t* tvb_string, asn1_ctx
if (ctx && ctx->do_address && tvb_string && ddatype) {
if (wmem_strbuf_get_len(ddatype) > 0) {
- proto_item_append_text (tree, " (%s=%s)", wmem_strbuf_get_str(ddatype), tvb_format_text(tvb_string, 0, tvb_length(tvb_string)));
+ proto_item_append_text (tree, " (%s=%s)", wmem_strbuf_get_str(ddatype), tvb_format_text(tvb_string, 0, tvb_captured_length(tvb_string)));
}
}
}
@@ -979,10 +979,10 @@ dissect_p1_MTAName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
if (ctx && ctx->do_address) {
- proto_item_append_text(actx->subtree.tree, " %s", tvb_format_text(mtaname, 0, tvb_length(mtaname)));
+ proto_item_append_text(actx->subtree.tree, " %s", tvb_format_text(mtaname, 0, tvb_captured_length(mtaname)));
} else {
if (mtaname) {
- col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(mtaname, 0, tvb_length(mtaname)));
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(mtaname, 0, tvb_captured_length(mtaname)));
}
}
@@ -1714,10 +1714,10 @@ dissect_p1_LocalIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
if(id) {
if (ctx && ctx->do_address)
- proto_item_append_text(actx->subtree.tree, " $ %s)", tvb_format_text(id, 0, tvb_length(id)));
+ proto_item_append_text(actx->subtree.tree, " $ %s)", tvb_format_text(id, 0, tvb_captured_length(id)));
if (hf_index == hf_p1_subject_identifier)
- col_append_fstr(actx->pinfo->cinfo, COL_INFO, " $ %s)", tvb_format_text(id, 0, tvb_length(id)));
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " $ %s)", tvb_format_text(id, 0, tvb_captured_length(id)));
}
@@ -2200,12 +2200,12 @@ dissect_p1_T_extension_attribute_value(gboolean implicit_tag _U_, tvbuff_t *tvb
proto_item_append_text(tree, " (%s)", val_to_str(actx->external.indirect_reference, p1_ExtensionAttributeType_vals, "extension-attribute-type %d"));
if (dissector_try_uint(p1_extension_attribute_dissector_table, actx->external.indirect_reference, tvb, actx->pinfo, tree)) {
- offset =tvb_length(tvb);
+ offset =tvb_captured_length(tvb);
} else {
proto_item *item = NULL;
proto_tree *next_tree = NULL;
- item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset),
+ item = proto_tree_add_text(tree, tvb, 0, tvb_captured_length_remaining(tvb, offset),
"Dissector for extension-attribute-type %d not implemented. Contact Wireshark developers if you want this supported", actx->external.indirect_reference);
next_tree = proto_item_add_subtree(item, ett_p1_unknown_extension_attribute_type);
offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree);
@@ -2667,7 +2667,7 @@ dissect_p1_Time(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, as
if(arrival && ctx && ctx->do_address)
- proto_item_append_text(actx->subtree.tree, " %s", tvb_format_text(arrival, 0, tvb_length(arrival)));
+ proto_item_append_text(actx->subtree.tree, " %s", tvb_format_text(arrival, 0, tvb_captured_length(arrival)));
@@ -3046,12 +3046,12 @@ dissect_p1_ExtensionValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
if(actx->external.indirect_ref_present) {
proto_item_append_text(tree, " (%s)", val_to_str(actx->external.indirect_reference, p1_StandardExtension_vals, "standard-extension %d"));
if (dissector_try_uint(p1_extension_dissector_table, actx->external.indirect_reference, tvb, actx->pinfo, tree)) {
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
} else {
proto_item *item = NULL;
proto_tree *next_tree = NULL;
- item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset),
+ item = proto_tree_add_text(tree, tvb, 0, tvb_captured_length_remaining(tvb, offset),
"Dissector for standard-extension %d not implemented. Contact Wireshark developers if you want this supported", actx->external.indirect_reference);
next_tree = proto_item_add_subtree(item, ett_p1_unknown_standard_extension);
offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree);
@@ -3229,7 +3229,7 @@ dissect_p1_Content(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
/* we can do this now constructed octet strings are supported */
offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &next_tvb);
- proto_item_set_text(actx->created_item, "content (%u bytes)", tvb_length (next_tvb));
+ proto_item_set_text(actx->created_item, "content (%u bytes)", tvb_captured_length (next_tvb));
if (next_tvb) {
if (ctx && ctx->content_type_id) {
@@ -3239,7 +3239,7 @@ dissect_p1_Content(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
proto_tree *next_tree = NULL;
proto_tree_add_expert(actx->subtree.top_tree ? actx->subtree.top_tree : tree, actx->pinfo, &ei_p1_unknown_built_in_content_type,
- next_tvb, 0, tvb_length_remaining(tvb, offset));
+ next_tvb, 0, tvb_captured_length_remaining(tvb, offset));
if (item) {
next_tree=proto_item_add_subtree(item, ett_p1_content_unknown);
}
@@ -7200,12 +7200,12 @@ dissect_p1_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
proto_item_append_text(tree, " (%s)", val_to_str(actx->external.indirect_reference, p1_TokenDataType_vals, "tokendata-type %d"));
if (dissector_try_uint(p1_tokendata_dissector_table, actx->external.indirect_reference, tvb, actx->pinfo, tree)) {
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
} else {
proto_item *item = NULL;
proto_tree *next_tree = NULL;
- item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset),
+ item = proto_tree_add_text(tree, tvb, 0, tvb_captured_length_remaining(tvb, offset),
"Dissector for tokendata-type %d not implemented. Contact Wireshark developers if you want this supported", actx->external.indirect_reference);
next_tree = proto_item_add_subtree(item, ett_p1_unknown_tokendata_type);
offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree);
@@ -8393,7 +8393,7 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported P1 PDU");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
col_set_str(pinfo->cinfo, COL_INFO, p1_op_name);
@@ -8407,7 +8407,7 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat
}
}
p1_initialize_content_globals (&asn1_ctx, NULL, FALSE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-p22.c b/epan/dissectors/packet-p22.c
index 40d983f71f..bd70e301a5 100644
--- a/epan/dissectors/packet-p22.c
+++ b/epan/dissectors/packet-p22.c
@@ -1234,7 +1234,7 @@ dissect_p22_SubjectField(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
if(subject)
- col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%s)", tvb_format_text(subject, 0, tvb_length(subject)));
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%s)", tvb_format_text(subject, 0, tvb_captured_length(subject)));
diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c
index 6ad31e47db..373ff2029a 100644
--- a/epan/dissectors/packet-p_mul.c
+++ b/epan/dissectors/packet-p_mul.c
@@ -913,7 +913,7 @@ static int dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
/* Checksum */
en = proto_tree_add_item (p_mul_tree, hf_checksum, tvb, offset, 2, ENC_BIG_ENDIAN);
checksum_tree = proto_item_add_subtree (en, ett_checksum);
- len = tvb_length (tvb);
+ len = tvb_captured_length (tvb);
value = (guint8 *)tvb_memdup (wmem_packet_scope(), tvb, 0, len);
checksum1 = checksum (value, len, offset);
checksum2 = tvb_get_ntohs (tvb, offset);
@@ -1059,7 +1059,7 @@ static int dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
case Data_PDU:
/* Fragment of Data (variable length) */
- data_len = tvb_length_remaining (tvb, offset);
+ data_len = tvb_captured_length_remaining (tvb, offset);
proto_tree_add_none_format (p_mul_tree, hf_data_fragment, tvb, offset,
data_len, "Fragment %d of Data (%d byte%s)",
seq_no, data_len,
@@ -1174,7 +1174,7 @@ static int dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
}
proto_item_append_text (ti, ", Count of Ack: %u", count);
- if (tvb_length_remaining (tvb, offset) >= 8) {
+ if (tvb_captured_length_remaining (tvb, offset) >= 8) {
/* Timestamp Option (in units of 100ms) */
guint64 timestamp;
@@ -1303,7 +1303,7 @@ static int dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
proto_item_append_text (len_en, " (incorrect, should be: %d)",
offset + data_len);
expert_add_info(pinfo, len_en, &ei_length);
- } else if ((len = tvb_length_remaining (tvb, pdu_length)) > 0) {
+ } else if ((len = tvb_captured_length_remaining (tvb, pdu_length)) > 0) {
proto_item_append_text (len_en, " (more data in packet: %d)", len);
expert_add_info(pinfo, len_en, &ei_more_data);
}
diff --git a/epan/dissectors/packet-packetlogger.c b/epan/dissectors/packet-packetlogger.c
index 0a4d756deb..4cd1ce8849 100644
--- a/epan/dissectors/packet-packetlogger.c
+++ b/epan/dissectors/packet-packetlogger.c
@@ -87,7 +87,7 @@ static void dissect_packetlogger (tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_tree_add_item (packetlogger_tree, hf_type, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_item_append_text (ti, " %s", val_to_str (pl_type, type_vals, "Unknown 0x%02x"));
- len = tvb_length_remaining (tvb, 1);
+ len = tvb_captured_length_remaining (tvb, 1);
next_tvb = tvb_new_subset_remaining (tvb, 1);
if (pl_type <= PKT_RECV_ACL_DATA) {
diff --git a/epan/dissectors/packet-paltalk.c b/epan/dissectors/packet-paltalk.c
index 97862727d4..aeadad82c7 100644
--- a/epan/dissectors/packet-paltalk.c
+++ b/epan/dissectors/packet-paltalk.c
@@ -75,7 +75,7 @@ dissect_paltalk_desegmented(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(pt_tree, hf_paltalk_content, tvb, 6, tvb_get_ntohs(tvb, 4), ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
diff --git a/epan/dissectors/packet-pana.c b/epan/dissectors/packet-pana.c
index a2c4afb1a5..a9d90db51b 100644
--- a/epan/dissectors/packet-pana.c
+++ b/epan/dissectors/packet-pana.c
@@ -668,7 +668,7 @@ dissect_pana(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
guint32 avp_length;
/* Get actual buffer length */
- buffer_length = tvb_length(tvb);
+ buffer_length = tvb_captured_length(tvb);
/* Check minimum buffer length */
if(buffer_length < 12) {
diff --git a/epan/dissectors/packet-pathport.c b/epan/dissectors/packet-pathport.c
index 0e2543973b..a73f437d54 100644
--- a/epan/dissectors/packet-pathport.c
+++ b/epan/dissectors/packet-pathport.c
@@ -547,7 +547,7 @@ dissect_header(tvbuff_t *tvb, proto_tree *parent, guint offset)
static gboolean
packet_is_pathport(tvbuff_t *tvb)
{
- if(tvb_length(tvb) < PATHPORT_MIN_LENGTH)
+ if(tvb_captured_length(tvb) < PATHPORT_MIN_LENGTH)
return FALSE;
if(tvb_get_ntohs(tvb, 0) != PATHPORT_PROTO_MAGIC)
diff --git a/epan/dissectors/packet-pcap.c b/epan/dissectors/packet-pcap.c
index 99fca83470..f066497e60 100644
--- a/epan/dissectors/packet-pcap.c
+++ b/epan/dissectors/packet-pcap.c
@@ -13523,32 +13523,32 @@ static int dissect_PCAP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_OutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/epan/dissectors/packet-pcep.c b/epan/dissectors/packet-pcep.c
index bd3d245ce6..833ea788f2 100644
--- a/epan/dissectors/packet-pcep.c
+++ b/epan/dissectors/packet-pcep.c
@@ -2613,7 +2613,7 @@ dissect_pcep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
col_clear(pinfo->cinfo, COL_INFO);
dissect_pcep_msg_tree(tvb, tree, ett_pcep, pinfo);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -2621,7 +2621,7 @@ dissect_pcep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4, get_pcep_message_len,
dissect_pcep_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*Register the protocol with wireshark*/
diff --git a/epan/dissectors/packet-pcp.c b/epan/dissectors/packet-pcp.c
index 888a11d93d..1e3376cf32 100644
--- a/epan/dissectors/packet-pcp.c
+++ b/epan/dissectors/packet-pcp.c
@@ -1483,14 +1483,14 @@ static int dissect_pcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
expert_add_info(pinfo, pcp_tree, &ei_pcp_unimplemented_packet_type);
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_pcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
/* pass all packets through TCP-reassembally */
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, PCP_HEADER_LEN, get_pcp_message_len, dissect_pcp_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* setup the dissecting */
diff --git a/epan/dissectors/packet-peekremote.c b/epan/dissectors/packet-peekremote.c
index c198dfdaa9..da951e2738 100644
--- a/epan/dissectors/packet-peekremote.c
+++ b/epan/dissectors/packet-peekremote.c
@@ -467,7 +467,7 @@ dissect_peekremote_legacy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
*/
if (dissect_peekremote_new(tvb, pinfo, tree, u)) {
/* Yup, it was peekremote-ng, and it's been dissected as such. */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PEEKREMOTE");
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index 2a343dc02c..2fcb56d427 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -164,7 +164,7 @@ static tvbuff_t *new_octet_aligned_subset(tvbuff_t *tvb, guint32 offset, asn1_ct
/* XXX - why are we doing this? Shouldn't we throw an exception if we've
* been asked to decode more octets than exist?
*/
- actual_length = tvb_length_remaining(tvb,boffset);
+ actual_length = tvb_captured_length_remaining(tvb,boffset);
if (length <= actual_length)
actual_length = length;
@@ -991,7 +991,7 @@ dissect_per_any_oid_str(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_t
offset = dissect_per_any_oid(tvb, offset, actx, tree, hf_index, (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 = "";
diff --git a/epan/dissectors/packet-pgm.c b/epan/dissectors/packet-pgm.c
index 6dc1f3c95f..e0f75c0d19 100644
--- a/epan/dissectors/packet-pgm.c
+++ b/epan/dissectors/packet-pgm.c
@@ -922,7 +922,7 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "not available");
} else {
reportedlen = tvb_reported_length(tvb);
- pgmlen = tvb_length(tvb);
+ pgmlen = tvb_captured_length(tvb);
if (pgm_check_checksum && pgmlen >= reportedlen) {
vec_t cksum_vec[1];
guint16 computed_cksum;
diff --git a/epan/dissectors/packet-pgsql.c b/epan/dissectors/packet-pgsql.c
index ee1d3e7797..3b1d4d04c0 100644
--- a/epan/dissectors/packet-pgsql.c
+++ b/epan/dissectors/packet-pgsql.c
@@ -638,7 +638,7 @@ dissect_pgsql_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
dissect_pgsql_be_msg(type, length, tvb, n, ptree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* This function is called once per TCP packet. It sets COL_PROTOCOL and
@@ -662,7 +662,7 @@ dissect_pgsql(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
tcp_dissect_pdus(tvb, pinfo, tree, pgsql_desegment, 5,
pgsql_length, dissect_pgsql_msg, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c
index e0a5a88056..1f8fdb0246 100644
--- a/epan/dissectors/packet-pim.c
+++ b/epan/dissectors/packet-pim.c
@@ -186,7 +186,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* 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);
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PIMv1");
@@ -217,7 +217,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 2;
proto_tree_add_item(pim_tree, hf_pim_version, tvb, offset, 1, ENC_BIG_ENDIAN);
- return offset+tvb_length_remaining(tvb, offset);
+ return offset+tvb_captured_length_remaining(tvb, offset);
}
/*
@@ -225,7 +225,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* Register message, and thus can figure out how much to
* checksum and whether to make the columns read-only.
*/
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (pim_type == 1) {
/*
* Register message - the PIM header is 8 bytes long.
@@ -490,7 +490,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
done:;
- return offset+tvb_length_remaining(tvb, offset);
+ return offset+tvb_captured_length_remaining(tvb, offset);
}
static gboolean
@@ -719,7 +719,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree_add_item(pim_tree, hf_pim_type, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(pim_tree, hf_pim_res_bytes, tvb, offset + 1, 1, ENC_NA);
pim_cksum = tvb_get_ntohs(tvb, offset + 2);
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (PIM_VER(pim_typever) == 2) {
/*
* Well, it's PIM v2, so we can check whether this is a Register
diff --git a/epan/dissectors/packet-pkcs12.c b/epan/dissectors/packet-pkcs12.c
index fbcd8fa900..2ec622dd14 100644
--- a/epan/dissectors/packet-pkcs12.c
+++ b/epan/dissectors/packet-pkcs12.c
@@ -204,7 +204,7 @@ generate_key_or_iv(unsigned int id, tvbuff_t *salt_tvb, unsigned int iter,
cur_keylen = 0;
- salt_size = tvb_length(salt_tvb);
+ salt_size = tvb_captured_length(salt_tvb);
salt_p = (char *)tvb_memdup(wmem_packet_scope(), salt_tvb, 0, salt_size);
if (pw == NULL)
@@ -405,7 +405,7 @@ int PBE_decrypt_data(const char *object_identifier_id_param, tvbuff_t *encrypted
}
}
- datalen = tvb_length(encrypted_tvb);
+ datalen = tvb_captured_length(encrypted_tvb);
clear_data = (char *)g_malloc(datalen);
err = gcry_cipher_decrypt (cipher, clear_data, datalen, (char *)tvb_memdup(wmem_packet_scope(), encrypted_tvb, 0, datalen), datalen);
diff --git a/epan/dissectors/packet-pkix1explicit.c b/epan/dissectors/packet-pkix1explicit.c
index 09f61fdcbc..2151c3c6b1 100644
--- a/epan/dissectors/packet-pkix1explicit.c
+++ b/epan/dissectors/packet-pkix1explicit.c
@@ -559,7 +559,7 @@ dissect_pkix1explicit_T_addressFamily(gboolean implicit_tag _U_, tvbuff_t *tvb _
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_pkix1explicit_addressFamily);
proto_tree_add_item(subtree, hf_pkix1explicit_addressFamily_afn, parameter_tvb, 0, 2, ENC_BIG_ENDIAN);
- if(tvb_length(parameter_tvb)>2)
+ if(tvb_captured_length(parameter_tvb)>2)
proto_tree_add_item(subtree, hf_pkix1explicit_addressFamily_safi, parameter_tvb, 0, 2, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-pktc.c b/epan/dissectors/packet-pktc.c
index 7a577d72a1..d21be24ae3 100644
--- a/epan/dissectors/packet-pktc.c
+++ b/epan/dissectors/packet-pktc.c
@@ -525,7 +525,7 @@ dissect_pktc_mtafqdn_krbsafeuserdata(packet_info *pinfo, tvbuff_t *tvb, proto_tr
case PKTC_MTAFQDN_REP:
/* MTA FQDN */
- string_len = tvb_length_remaining(tvb, offset) - 4;
+ string_len = tvb_captured_length_remaining(tvb, offset) - 4;
if (string_len <= 0)
THROW(ReportedBoundsError);
proto_tree_add_item(tree, hf_pktc_mtafqdn_fqdn, tvb, offset, string_len, ENC_ASCII|ENC_NA);
diff --git a/epan/dissectors/packet-pktgen.c b/epan/dissectors/packet-pktgen.c
index 675fe27a16..d5928c3e97 100644
--- a/epan/dissectors/packet-pktgen.c
+++ b/epan/dissectors/packet-pktgen.c
@@ -66,7 +66,7 @@ static gboolean dissect_pktgen(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
guint32 magic;
/* check for min size */
- if (tvb_length(tvb) < 16) { /* Not a PKTGEN packet. */
+ if (tvb_captured_length(tvb) < 16) { /* Not a PKTGEN packet. */
return FALSE;
}
@@ -113,11 +113,11 @@ static gboolean dissect_pktgen(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
proto_tree_add_time(pktgen_tree, hf_pktgen_timestamp, tvb, offset - 8, 8, &tstamp);
#if 0
- if (tvb_length_remaining(tvb, offset)) /* random data */
+ if (tvb_captured_length_remaining(tvb, offset)) /* random data */
proto_tree_add_text(pktgen_tree, tvb, offset, -1, "Data (%u bytes)",
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
#else
- if (tvb_length_remaining(tvb, offset)) /* random data */
+ if (tvb_captured_length_remaining(tvb, offset)) /* random data */
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
pktgen_tree);
#endif
diff --git a/epan/dissectors/packet-pnrp.c b/epan/dissectors/packet-pnrp.c
index 009ed2684d..569e0dbce3 100644
--- a/epan/dissectors/packet-pnrp.c
+++ b/epan/dissectors/packet-pnrp.c
@@ -351,7 +351,7 @@ static int dissect_pnrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
* Validate if it is really a PNRP Packet
*----------------------------------------*/
/* Check that there's enough data */
- /* XXX: ISTR that tvb_length should be used when */
+ /* XXX: ISTR that tvb_captured_length should be used when */
/* initially checking for a valid packet for a */
/* new style dissector. */
/* ToDo: confirm */
diff --git a/epan/dissectors/packet-pop.c b/epan/dissectors/packet-pop.c
index c111b05ba0..a6fa21ca4b 100644
--- a/epan/dissectors/packet-pop.c
+++ b/epan/dissectors/packet-pop.c
@@ -203,7 +203,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Otherwise, just call it a continuation.
*/
if (is_continuation) {
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
col_add_fstr(pinfo->cinfo, COL_INFO, "S: DATA fragment, %d byte%s",
length_remaining, plurality (length_remaining, "", "s"));
}
@@ -220,7 +220,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!frame_data_p) {
- data_val->msg_read_len += tvb_length(tvb);
+ data_val->msg_read_len += tvb_captured_length(tvb);
frame_data_p = wmem_new(wmem_file_scope(), struct pop_proto_data);
@@ -234,7 +234,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo,
frame_data_p->conversation_id,
NULL,
- tvb_length(tvb),
+ tvb_captured_length(tvb),
frame_data_p->more_frags);
next_tvb = process_reassembled_data(tvb, offset, pinfo,
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c
index e4bb771926..cc0932f24a 100644
--- a/epan/dissectors/packet-ppi.c
+++ b/epan/dissectors/packet-ppi.c
@@ -914,7 +914,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (ppi_ampdu_reassemble && DOT11N_IS_AGGREGATE(n_ext_flags)) {
- len_remain = tvb_length_remaining(tvb, offset);
+ len_remain = tvb_captured_length_remaining(tvb, offset);
#if 0 /* XXX: pad_len never actually used ?? */
if (DOT11N_MORE_AGGREGATES(n_ext_flags)) {
pad_len = PADDING4(len_remain);
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index c2e225f558..31a6e26901 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -1608,7 +1608,7 @@ static const ip_tcp_opt ipv6cp_opts[] = {
static guint16
fcs16(tvbuff_t *tvbuff)
{
- guint len = tvb_length(tvbuff) - 2;
+ guint len = tvb_captured_length(tvbuff) - 2;
/* Check for Invalid Length */
if (len == 0)
@@ -1624,7 +1624,7 @@ fcs16(tvbuff_t *tvbuff)
static guint32
fcs32(tvbuff_t *tvbuff)
{
- guint len = tvb_length(tvbuff) - 4;
+ guint len = tvb_captured_length(tvbuff) - 4;
/* Check for invalid Length */
if (len == 0)
@@ -1654,7 +1654,7 @@ decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int proto_offset)
/*
* Do we have the entire packet, and does it include a 2-byte FCS?
*/
- len = tvb_length_remaining(tvb, proto_offset);
+ len = tvb_captured_length_remaining(tvb, proto_offset);
reported_len = tvb_reported_length_remaining(tvb, proto_offset);
if (reported_len < 2 || len < 0) {
/*
@@ -1706,7 +1706,7 @@ decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int proto_offset)
/*
* Do we have the entire packet, and does it include a 4-byte FCS?
*/
- len = tvb_length_remaining(tvb, proto_offset);
+ len = tvb_captured_length_remaining(tvb, proto_offset);
reported_len = tvb_reported_length_remaining(tvb, proto_offset);
if (reported_len < 4) {
/*
@@ -4266,7 +4266,7 @@ dissect_bcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (!(flags & BCP_IS_BCONTROL)) {
- captured_length = tvb_length_remaining(tvb, offset);
+ captured_length = tvb_captured_length_remaining(tvb, offset);
reported_length = tvb_reported_length_remaining(tvb, offset);
pad_length = flags & BCP_PADS_MASK;
if (reported_length >= pad_length) {
@@ -5070,7 +5070,7 @@ dissect_ppp_raw_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
if (tree)
proto_tree_add_text(bs_tree, tvb, offset, -1, "PPP Fragment");
offset++;
- length = tvb_length_remaining(tvb,offset);
+ length = tvb_captured_length_remaining(tvb,offset);
ppp_tvb = remove_escape_chars(tvb, pinfo, offset,length);
if (ppp_tvb != NULL) {
add_new_data_source(pinfo, ppp_tvb, "PPP Fragment");
@@ -5110,7 +5110,7 @@ dissect_ppp_raw_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
if (tree)
proto_tree_add_text(bs_tree, tvb, offset, -1, "PPP Fragment");
offset++;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
ppp_tvb = remove_escape_chars(tvb, pinfo, offset, length);
if (ppp_tvb != NULL) {
add_new_data_source(pinfo, ppp_tvb, "PPP Fragment");
diff --git a/epan/dissectors/packet-pppoe.c b/epan/dissectors/packet-pppoe.c
index fbf8f2e9e6..383e767365 100644
--- a/epan/dissectors/packet-pppoe.c
+++ b/epan/dissectors/packet-pppoe.c
@@ -1181,7 +1181,7 @@ static void dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Construct a tvbuff containing the PPP packet.
*/
- length = tvb_length_remaining(tvb, 6);
+ length = tvb_captured_length_remaining(tvb, 6);
reported_length = tvb_reported_length_remaining(tvb, 6);
DISSECTOR_ASSERT(length >= 0);
DISSECTOR_ASSERT(reported_length >= 0);
diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c
index 01f0e23843..4ba5f560e9 100644
--- a/epan/dissectors/packet-pres.c
+++ b/epan/dissectors/packet-pres.c
@@ -1470,7 +1470,7 @@ dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
/* dissect the packet */
dissect_UD_type_PDU(tvb, pinfo, clpres_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* we can't make any additional checking here */
@@ -1488,7 +1488,7 @@ dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
proto_tree_add_text(parent_tree, tvb, offset,
tvb_reported_length_remaining(tvb,offset),"User data");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
while (tvb_reported_length_remaining(tvb, offset) > 0){
@@ -1500,7 +1500,7 @@ dissect_pres(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-ptp.c b/epan/dissectors/packet-ptp.c
index 81f1be08a0..47d281b46f 100644
--- a/epan/dissectors/packet-ptp.c
+++ b/epan/dissectors/packet-ptp.c
@@ -3031,7 +3031,7 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *ptp_tlv_period;
proto_tree *ptp_tlv_period_tree;
- proto_len = tvb_length(tvb);
+ proto_len = tvb_captured_length(tvb);
tlv_offset = PTP_V2_SIG_TLV_START;
while (tlv_offset < proto_len) {
diff --git a/epan/dissectors/packet-ptpip.c b/epan/dissectors/packet-ptpip.c
index 8b61a9d0fb..8fd62c165a 100644
--- a/epan/dissectors/packet-ptpip.c
+++ b/epan/dissectors/packet-ptpip.c
@@ -492,7 +492,7 @@ int dissect_ptpIP (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
guint32 pktType;
/* Check that there's enough data */
- if ( tvb_length_remaining(tvb, offset) < 8 ) /* ptp-photo smallest packet size is 8 */
+ if ( tvb_captured_length_remaining(tvb, offset) < 8 ) /* ptp-photo smallest packet size is 8 */
return (0);
col_set_str(pinfo->cinfo,COL_PROTOCOL, "PTP/IP");
diff --git a/epan/dissectors/packet-pulse.c b/epan/dissectors/packet-pulse.c
index 59b5071e05..5be79fa941 100644
--- a/epan/dissectors/packet-pulse.c
+++ b/epan/dissectors/packet-pulse.c
@@ -63,7 +63,7 @@ dissect_pulse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
const char* magic_str;
guint little_endian;
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return 0;
/* Try to read MAGIC in both endians */
diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c
index 5d97f3ea07..affa30c362 100644
--- a/epan/dissectors/packet-pvfs2.c
+++ b/epan/dissectors/packet-pvfs2.c
@@ -812,7 +812,7 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset,
string_length += 1;
}
- string_length_captured = tvb_length_remaining(tvb, data_offset);
+ string_length_captured = tvb_captured_length_remaining(tvb, data_offset);
string_length_packet = tvb_reported_length_remaining(tvb, data_offset);
/*
@@ -846,7 +846,7 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset,
else
fill_length = string_length_full - string_length - 4;
- fill_length_captured = tvb_length_remaining(tvb,
+ fill_length_captured = tvb_captured_length_remaining(tvb,
data_offset + string_length);
fill_length_packet = tvb_reported_length_remaining(tvb,
data_offset + string_length);
@@ -1535,7 +1535,7 @@ dissect_pvfs2_io_request(tvbuff_t *tvb, proto_tree *tree, int offset,
/*offset = */dissect_pvfs_pint_request(tvb, tree, offset);
/* TODO: remove this!!! */
- offset = tvb_length(tvb) - 16;
+ offset = tvb_captured_length(tvb) - 16;
/* offset */
proto_tree_add_item(tree, hf_pvfs_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
@@ -2381,7 +2381,7 @@ dissect_pvfs2_getconfig_response(tvbuff_t *tvb, proto_tree *parent_tree,
ptr = tvb_get_ptr(tvb, offset, total_config_bytes);
/* Check if all data is available */
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining < total_config_bytes)
{
diff --git a/epan/dissectors/packet-pw-atm.c b/epan/dissectors/packet-pw-atm.c
index 7b862c3e91..eb30c8da95 100644
--- a/epan/dissectors/packet-pw-atm.c
+++ b/epan/dissectors/packet-pw-atm.c
@@ -1169,7 +1169,7 @@ dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, voi
expert_add_info_format(pinfo, item, &ei_pw_payload_size_invalid_error,
"Packet (size: %d) is too small to carry MPLS PW Control Word"
,(int)size);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
@@ -1331,7 +1331,7 @@ dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, voi
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index 493dbde58e..5780803f02 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -2755,7 +2755,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree,
* to the actual size in the frame
*/
if (!pinfo->can_desegment) {
- info_element_len = MIN(info_element_len, tvb_length_remaining(tvb, offset + 3));
+ info_element_len = MIN(info_element_len, tvb_captured_length_remaining(tvb, offset + 3));
}
/*
* Do we have a handle for the H.225
@@ -3117,7 +3117,7 @@ dissect_q931_tpkt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
* is one, and that the code put a TPKT header in one
* segment and the rest of the PDU in another.
*/
- if (tvb_length(tvb) == 4) {
+ if (tvb_captured_length(tvb) == 4) {
/*
* It is - call the "dissect TPKT over a TCP stream"
* routine.
diff --git a/epan/dissectors/packet-q932-ros.c b/epan/dissectors/packet-q932-ros.c
index 59a37a30eb..2ba745667c 100644
--- a/epan/dissectors/packet-q932-ros.c
+++ b/epan/dissectors/packet-q932-ros.c
@@ -248,12 +248,12 @@ dissect_q932_ros_InvokeArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
#line 68 "../../asn1/q932-ros/q932-ros.cnf"
gint len;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
arg_next_tvb = tvb_new_subset_remaining(tvb, offset);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
@@ -326,12 +326,12 @@ dissect_q932_ros_ResultArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
#line 86 "../../asn1/q932-ros/q932-ros.cnf"
gint len;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
res_next_tvb = tvb_new_subset_remaining(tvb, offset);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
@@ -422,12 +422,12 @@ dissect_q932_ros_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
gint len;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
err_next_tvb = tvb_new_subset_remaining(tvb, offset);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
diff --git a/epan/dissectors/packet-q932.c b/epan/dissectors/packet-q932.c
index 5b04993d82..e7b7cc6cdc 100644
--- a/epan/dissectors/packet-q932.c
+++ b/epan/dissectors/packet-q932.c
@@ -770,7 +770,7 @@ dissect_q932_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree_add_item(ie_tree, hf_q932_ie_type, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ie_tree, hf_q932_ie_len, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
offset += 2;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
switch (ie_type) {
case Q932_IE_FACILITY :
diff --git a/epan/dissectors/packet-qllc.c b/epan/dissectors/packet-qllc.c
index d75d924cc3..dcfed06123 100644
--- a/epan/dissectors/packet-qllc.c
+++ b/epan/dissectors/packet-qllc.c
@@ -91,7 +91,7 @@ dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
*/
if (!(*q_bit_set)) {
call_dissector(sna_handle, tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Summary information */
@@ -157,7 +157,7 @@ dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
/* yes */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-qsig.c b/epan/dissectors/packet-qsig.c
index 461b0e15a8..7bf19d8de1 100644
--- a/epan/dissectors/packet-qsig.c
+++ b/epan/dissectors/packet-qsig.c
@@ -2079,14 +2079,14 @@ dissect_qsig_T_extensionArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i
proto_item *item=NULL;
proto_tree *next_tree=NULL;
- item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "QSIG: Dissector for extension with OID:%s not implemented.", extension_oid);
+ item=proto_tree_add_text(tree, next_tvb, 0, tvb_captured_length_remaining(tvb, offset), "QSIG: Dissector for extension with OID:%s not implemented.", extension_oid);
if(item){
next_tree=proto_item_add_subtree(item, ett_qsig_unknown_extension);
}
dissect_unknown_ber(actx->pinfo, next_tvb, offset, next_tree);
}
- offset+=tvb_length_remaining(tvb, offset);
+ offset+=tvb_captured_length_remaining(tvb, offset);
return offset;
@@ -2122,7 +2122,7 @@ dissect_qsig_PSS1InformationElement_U(gboolean implicit_tag _U_, tvbuff_t *tvb _
&out_tvb);
data_tree = proto_item_add_subtree(actx->created_item, ett_cnq_PSS1InformationElement);
- if (out_tvb && (tvb_length(out_tvb) > 0) && q931_ie_handle)
+ if (out_tvb && (tvb_captured_length(out_tvb) > 0) && q931_ie_handle)
call_dissector(q931_ie_handle, out_tvb, actx->pinfo, data_tree);
@@ -12408,7 +12408,7 @@ dissect_qsig_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return offset;
service = get_service(opcode);
- ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_captured_length(tvb), ENC_NA);
qsig_tree = proto_item_add_subtree(ti, ett_qsig);
proto_tree_add_uint(qsig_tree, hf_qsig_operation, tvb, 0, 0, opcode);
@@ -12427,9 +12427,9 @@ dissect_qsig_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (op_ptr->arg_pdu)
offset = op_ptr->arg_pdu(tvb, pinfo, qsig_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(qsig_tree, tvb, offset, -1, "UNSUPPORTED ARGUMENT TYPE (QSIG)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -12462,7 +12462,7 @@ dissect_qsig_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return offset;
service = get_service(opcode);
- ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_captured_length(tvb), ENC_NA);
qsig_tree = proto_item_add_subtree(ti, ett_qsig);
proto_tree_add_uint(qsig_tree, hf_qsig_operation, tvb, 0, 0, opcode);
@@ -12481,9 +12481,9 @@ dissect_qsig_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (op_ptr->res_pdu)
offset = op_ptr->res_pdu(tvb, pinfo, qsig_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(qsig_tree, tvb, offset, -1, "UNSUPPORTED RESULT TYPE (QSIG)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -12515,7 +12515,7 @@ dissect_qsig_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (!err_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_captured_length(tvb), ENC_NA);
qsig_tree = proto_item_add_subtree(ti, ett_qsig);
proto_tree_add_uint(qsig_tree, hf_qsig_error, tvb, 0, 0, errcode);
@@ -12530,9 +12530,9 @@ dissect_qsig_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (err_ptr->err_pdu)
offset = err_ptr->err_pdu(tvb, pinfo, qsig_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(qsig_tree, tvb, offset, -1, "UNSUPPORTED ERROR TYPE (QSIG)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -12577,7 +12577,7 @@ dissect_qsig_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int codeset
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_item(ie_tree, hf_qsig_ie_len, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
offset += 2;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
switch ((codeset << 8) | ie_type) {
case CS4 | QSIG_IE_TRANSIT_COUNTER :
diff --git a/epan/dissectors/packet-quake2.c b/epan/dissectors/packet-quake2.c
index 38b9212d23..142ba12f43 100644
--- a/epan/dissectors/packet-quake2.c
+++ b/epan/dissectors/packet-quake2.c
@@ -106,7 +106,7 @@ dissect_quake2_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo _U_,
/* all the rest of the packet is just text */
offset = 4;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
text = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII);
proto_tree_add_string(cl_tree, hf_quake2_connectionless_text,
tvb, offset, len, text);
diff --git a/epan/dissectors/packet-quake3.c b/epan/dissectors/packet-quake3.c
index 90459ec3f5..f4d19344b0 100644
--- a/epan/dissectors/packet-quake3.c
+++ b/epan/dissectors/packet-quake3.c
@@ -256,7 +256,7 @@ dissect_quake3_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo _U_,
\ with "<DATA>". */
if (text_item) {
/* first correct the length until the end of the packet */
- proto_item_set_len(text_item, tvb_length_remaining(tvb, offset));
+ proto_item_set_len(text_item, tvb_captured_length_remaining(tvb, offset));
/* then replace the text */
proto_item_set_text(text_item, "Text: getserversResponse<DATA>");
}
diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c
index cf1dfd4435..532def6842 100644
--- a/epan/dissectors/packet-quic.c
+++ b/epan/dissectors/packet-quic.c
@@ -108,7 +108,7 @@ dissect_quic_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 puflags, len_cid, len_seq;
guint64 cid, seq;
- if (tvb_length(tvb) < QUIC_MIN_LENGTH)
+ if (tvb_captured_length(tvb) < QUIC_MIN_LENGTH)
return 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "QUIC");
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index e245175bda..7e7570e81f 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -331,7 +331,7 @@ static const gchar *dissect_chap_password(proto_tree* tree, tvbuff_t* tvb, packe
proto_item *ti;
proto_tree *chap_tree;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len != 17)
return "[wrong length for CHAP-Password]";
@@ -348,7 +348,7 @@ static const gchar *dissect_framed_ip_address(proto_tree* tree, tvbuff_t* tvb, p
guint32 ip_h;
const gchar *str;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len != 4)
return "[wrong length for IP address]";
@@ -379,7 +379,7 @@ static const gchar *dissect_login_ip_host(proto_tree* tree, tvbuff_t* tvb, packe
guint32 ip_h;
const gchar *str;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len != 4)
return "[wrong length for IP address]";
@@ -418,7 +418,7 @@ static const gchar *dissect_ascend_data_filter(proto_tree* tree, tvbuff_t* tvb,
guint16 srcport, dstport;
guint8 srcportq, dstportq;
- len=tvb_length(tvb);
+ len=tvb_captured_length(tvb);
if (len != 24) {
return wmem_strdup_printf(wmem_packet_scope(), "Wrong attribute length %d", len);
@@ -471,7 +471,7 @@ static const gchar *dissect_framed_ipx_network(proto_tree* tree, tvbuff_t* tvb,
guint32 net;
const gchar *str;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len != 4)
return "[wrong length for IPX network]";
@@ -490,7 +490,7 @@ static const gchar *dissect_framed_ipx_network(proto_tree* tree, tvbuff_t* tvb,
static const gchar* dissect_cosine_vpvc(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo _U_) {
guint vpi, vci;
- if ( tvb_length(tvb) != 4 )
+ if ( tvb_captured_length(tvb) != 4 )
return "[Wrong Length for VP/VC AVP]";
vpi = tvb_get_ntohs(tvb,0);
@@ -1219,7 +1219,7 @@ void dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_
PROTO_ITEM_SET_GENERATED(avp_len_item);
}
- tvb_len = tvb_length_remaining(tvb, offset);
+ tvb_len = tvb_captured_length_remaining(tvb, offset);
if ((gint)avp_length < tvb_len)
tvb_len = avp_length;
@@ -1460,7 +1460,7 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
tvb, 2, 2, rh.rh_pktlength, "%u (bogus, < %u)",
rh.rh_pktlength, HDR_LENGTH);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
avplength = rh.rh_pktlength - HDR_LENGTH;
@@ -1721,7 +1721,7 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
avplength);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-radius_packetcable.c b/epan/dissectors/packet-radius_packetcable.c
index 663486291e..943809c66a 100644
--- a/epan/dissectors/packet-radius_packetcable.c
+++ b/epan/dissectors/packet-radius_packetcable.c
@@ -370,7 +370,7 @@ static const gchar* dissect_packetcable_redirected_from_info(proto_tree* tree, t
static const gchar* dissect_packetcable_time_electr_surv_ind(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo _U_) {
- if (tvb_length(tvb) == 0)
+ if (tvb_captured_length(tvb) == 0)
return "None";
proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_df_cdc_address,
@@ -381,7 +381,7 @@ static const gchar* dissect_packetcable_time_electr_surv_ind(proto_tree* tree, t
tvb, 8, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_ccc_port,
tvb, 10, 2, ENC_BIG_ENDIAN);
- proto_tree_add_text(tree, tvb, 12, tvb_length(tvb) - 12, "DF-DF-Key");
+ proto_tree_add_text(tree, tvb, 12, tvb_captured_length(tvb) - 12, "DF-DF-Key");
return "";
}
diff --git a/epan/dissectors/packet-ranap.c b/epan/dissectors/packet-ranap.c
index 543d6c567d..aa3b78b42d 100644
--- a/epan/dissectors/packet-ranap.c
+++ b/epan/dissectors/packet-ranap.c
@@ -4775,7 +4775,7 @@ dissect_ranap_IMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot
&& actx->pinfo->sccp_info->data.co.assoc
&& ! actx->pinfo->sccp_info->data.co.assoc->calling_party ) {
- guint len = tvb_length(imsi_tvb);
+ guint len = tvb_captured_length(imsi_tvb);
guint8* bytes = (guint8 *)tvb_memdup(wmem_packet_scope(),imsi_tvb,0,len);
actx->pinfo->sccp_info->data.co.assoc->calling_party =
@@ -7331,7 +7331,7 @@ dissect_ranap_RRC_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
NO_BOUND, NO_BOUND, FALSE, &rrc_message_tvb);
- if ((rrc_message_tvb)&&(tvb_length(rrc_message_tvb)!=0)&&(glbl_dissect_container)){
+ if ((rrc_message_tvb)&&(tvb_captured_length(rrc_message_tvb)!=0)&&(glbl_dissect_container)){
switch(ProtocolIE_ID){
case id_Source_ToTarget_TransparentContainer: /* INTEGER ::= 61 */
/* 9.2.1.30a Source to Target Transparent Container
@@ -7895,7 +7895,7 @@ dissect_ranap_TransportLayerAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
if (!parameter_tvb)
return offset;
/* Get the length */
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
subtree = proto_item_add_subtree(actx->created_item, ett_ranap_TransportLayerAddress);
if (tvb_len==4){
/* IPv4 */
@@ -13083,16 +13083,16 @@ dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
case id_RelocationPreparation:
if((ProtocolIE_ID == id_Source_ToTarget_TransparentContainer)||(ProtocolIE_ID == id_Target_ToSource_TransparentContainer)){
key = SPECIAL | ProtocolIE_ID;
- ret = (dissector_try_uint_new(ranap_ies_dissector_table, key, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ ret = (dissector_try_uint_new(ranap_ies_dissector_table, key, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
break;
}
/* Fall trough */
default:
/* no special handling */
- ret = (dissector_try_uint_new(ranap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ ret = (dissector_try_uint_new(ranap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
if (ret == 0) {
key = pdu_type | ProtocolIE_ID;
- ret = (dissector_try_uint_new(ranap_ies_dissector_table, key, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ ret = (dissector_try_uint_new(ranap_ies_dissector_table, key, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
break;
}
@@ -13102,19 +13102,19 @@ dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
static int
dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int
dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int
dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int
@@ -13125,7 +13125,7 @@ dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
pdu_type = IMSG;
ret = dissector_try_uint_new(ranap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL);
pdu_type = 0;
- return ret ? tvb_length(tvb) : 0;
+ return ret ? tvb_captured_length(tvb) : 0;
}
static int
@@ -13136,19 +13136,19 @@ dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
pdu_type = SOUT;
ret = dissector_try_uint_new(ranap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL);
pdu_type = 0;
- return ret ? tvb_length(tvb) : 0;
+ return ret ? tvb_captured_length(tvb) : 0;
}
static int
dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int
dissect_OutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
@@ -13204,12 +13204,12 @@ dissect_sccp_ranap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
#define LENGTH_OFFSET 3
#define MSG_TYPE_OFFSET 1
- if (tvb_length(tvb) < RANAP_MSG_MIN_LENGTH) { return FALSE; }
- /*if (tvb_get_guint8(tvb, LENGTH_OFFSET) != (tvb_length(tvb) - 4)) { return FALSE; }*/
+ if (tvb_captured_length(tvb) < RANAP_MSG_MIN_LENGTH) { return FALSE; }
+ /*if (tvb_get_guint8(tvb, LENGTH_OFFSET) != (tvb_captured_length(tvb) - 4)) { return FALSE; }*/
/* Read the length NOTE offset in bits */
offset = dissect_per_length_determinant(tvb, LENGTH_OFFSET<<3, &asn1_ctx, tree, -1, &length);
offset = offset>>3;
- if (length!= (tvb_length(tvb) - offset)){
+ if (length!= (tvb_captured_length(tvb) - offset)){
return FALSE;
}
diff --git a/epan/dissectors/packet-rdm.c b/epan/dissectors/packet-rdm.c
index 2c4f6704ce..a6461d3848 100644
--- a/epan/dissectors/packet-rdm.c
+++ b/epan/dissectors/packet-rdm.c
@@ -2122,7 +2122,7 @@ dissect_rdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
- if (offset < tvb_length(tvb))
+ if (offset < tvb_captured_length(tvb))
proto_tree_add_item(rdm_tree, hf_rdm_trailer, tvb,
offset, -1, ENC_NA);
}
diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c
index 8cf275dffd..612359f957 100644
--- a/epan/dissectors/packet-rdp.c
+++ b/epan/dissectors/packet-rdp.c
@@ -1690,7 +1690,7 @@ dissect_rdp_ClientData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
#if 0
printf("offset=%d, type=%x, length=%d, remaining=%d\n",
- offset, type, length, tvb_length_remaining(tvb, offset));
+ offset, type, length, tvb_captured_length_remaining(tvb, offset));
#endif
switch(type) {
@@ -1814,13 +1814,13 @@ dissect_rdp_ServerData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
* Note: If length is less than the header size (4 bytes) offset is advanced by 4 bytes
* to ensure that dissection eventually terminates.
*/
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
type = tvb_get_letohs(tvb, offset);
length = tvb_get_letohs(tvb, offset+2);
/* printf("offset=%d, type=%x, length=%d, remaining=%d\n",
- offset, type, length, tvb_length_remaining(tvb, offset)); */
+ offset, type, length, tvb_captured_length_remaining(tvb, offset)); */
switch(type) {
case SC_CORE:
diff --git a/epan/dissectors/packet-rdt.c b/epan/dissectors/packet-rdt.c
index 93dee3bdea..516013cdfb 100644
--- a/epan/dissectors/packet-rdt.c
+++ b/epan/dissectors/packet-rdt.c
@@ -313,7 +313,7 @@ static void dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Parse all RDT packets found in the frame */
- while (offset != -1 && tvb_length_remaining(tvb, offset))
+ while (offset != -1 && tvb_captured_length_remaining(tvb, offset))
{
/* Every packet type should have at least 3 bytes */
tvb_ensure_bytes_exist(tvb, offset, 3);
@@ -461,7 +461,7 @@ guint dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* More flags */
@@ -524,13 +524,13 @@ guint dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_captured_length_remaining(tvb, start_offset))
{
proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -589,7 +589,7 @@ guint dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* Stream ID expansion */
@@ -608,10 +608,10 @@ guint dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_captured_length_remaining(tvb, start_offset))
{
proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -660,7 +660,7 @@ guint dissect_rdt_bandwidth_report_packet(tvbuff_t *tvb, packet_info *pinfo, pro
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
proto_tree_add_item(tree, hf_rdt_brpt_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -673,10 +673,10 @@ guint dissect_rdt_bandwidth_report_packet(tvbuff_t *tvb, packet_info *pinfo, pro
col_append_str(pinfo->cinfo, COL_INFO, "BANDWIDTH-REPORT: ");
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_captured_length_remaining(tvb, start_offset))
{
proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -729,7 +729,7 @@ guint dissect_rdt_ack_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* XXX: The remaining data is unparsed. */
@@ -738,10 +738,10 @@ guint dissect_rdt_ack_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_append_fstr(pinfo->cinfo, COL_INFO, "ACK: lh=%u ", lost_high_flag);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_captured_length_remaining(tvb, start_offset))
{
proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -872,7 +872,7 @@ guint dissect_rdt_stream_end_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(tree, hf_rdt_stre_reason_code, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* XXX: Remainder is reason_text */
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "STREAM-END: stream-id=%02u ", stream_id);
@@ -923,7 +923,7 @@ guint dissect_rdt_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
col_append_str(pinfo->cinfo, COL_INFO, "REPORT: ");
@@ -932,10 +932,10 @@ guint dissect_rdt_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_captured_length_remaining(tvb, start_offset))
{
proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -985,7 +985,7 @@ guint dissect_rdt_latency_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
server_out_time = tvb_get_ntohl(tvb, offset);
@@ -995,10 +995,10 @@ guint dissect_rdt_latency_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto
col_append_fstr(pinfo->cinfo, COL_INFO, "LATENCY-REPORT: t=%u ", server_out_time);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_captured_length_remaining(tvb, start_offset))
{
proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -1133,7 +1133,7 @@ guint dissect_rdt_transport_info_response_packet(tvbuff_t *tvb, packet_info *pin
}
/* Report what is left */
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
col_append_str(pinfo->cinfo, COL_INFO, "RESPONSE: ");
@@ -1183,7 +1183,7 @@ guint dissect_rdt_bw_probing_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
proto_tree_add_item(tree, hf_rdt_bwpp_seqno, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1194,10 +1194,10 @@ guint dissect_rdt_bw_probing_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
col_append_str(pinfo->cinfo, COL_INFO, "BW-PROBING: ");
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_captured_length_remaining(tvb, start_offset))
{
proto_tree_add_text(tree, tvb, 0, 0, "Packet length invalid");
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -1216,7 +1216,7 @@ guint dissect_rdt_unknown_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
col_append_str(pinfo->cinfo, COL_INFO, "UNKNOWN-CTL: ");
diff --git a/epan/dissectors/packet-redbackli.c b/epan/dissectors/packet-redbackli.c
index b1f6eec744..cd93908fa5 100644
--- a/epan/dissectors/packet-redbackli.c
+++ b/epan/dissectors/packet-redbackli.c
@@ -146,7 +146,7 @@ redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
redbackli_tree = proto_item_add_subtree(ti, ett_redbackli);
}
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
offset = 0;
eoh = FALSE;
while (!eoh && (len > 2)) {
@@ -183,7 +183,7 @@ redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
guint8 avptype, avplen;
guint32 avpfound = 0;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len < MIN_REDBACKLI_SIZE)
return FALSE;
diff --git a/epan/dissectors/packet-reload-framing.c b/epan/dissectors/packet-reload-framing.c
index c1cf0d9341..7c7a4ef274 100644
--- a/epan/dissectors/packet-reload-framing.c
+++ b/epan/dissectors/packet-reload-framing.c
@@ -350,7 +350,7 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
next_tvb = tvb_new_subset(tvb, offset, effective_length - offset, message_length);
if (reload_handle == NULL) {
expert_add_info(pinfo, ti, &ei_reload_no_dissector);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
call_dissector_only(reload_handle, next_tvb, pinfo, tree, NULL);
}
@@ -443,7 +443,7 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
DISSECTOR_ASSERT_NOT_REACHED();
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -458,7 +458,7 @@ dissect_reload_framing_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* XXX: Check if we have a valid RELOAD Frame Type ? */
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, MIN_HDR_LENGTH,
get_reload_framing_message_length, dissect_reload_framing, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* ToDo: If a TCP connection is identified heuristically as reload-framing, then
diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c
index 89167111a7..2d99efa941 100644
--- a/epan/dissectors/packet-reload.c
+++ b/epan/dissectors/packet-reload.c
@@ -3934,7 +3934,7 @@ dissect_reload_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean update_col_info = TRUE;
offset = 0;
- effective_length = tvb_length(tvb);
+ effective_length = tvb_captured_length(tvb);
/* First, make sure we have enough data to do the check. */
if (effective_length < MIN_HDR_LENGTH)
@@ -4157,7 +4157,7 @@ dissect_reload_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = 0;
}
- effective_length = tvb_length(tvb);
+ effective_length = tvb_captured_length(tvb);
if (effective_length < msg_length) {
/* The effective length is too small for the packet */
expert_add_info(pinfo, NULL, &ei_reload_truncated_packet);
diff --git a/epan/dissectors/packet-rfid-pn532-hci.c b/epan/dissectors/packet-rfid-pn532-hci.c
index fe81c5b130..c1d555ed5a 100644
--- a/epan/dissectors/packet-rfid-pn532-hci.c
+++ b/epan/dissectors/packet-rfid-pn532-hci.c
@@ -81,7 +81,7 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
return 0;
usb_conv_info = (usb_conv_info_t *)data;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length < 6) return offset;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PN532_HCI");
@@ -91,7 +91,7 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
main_tree = proto_item_add_subtree(main_item, ett_pn532_hci);
length = 0;
- while (tvb_length_remaining(tvb, length) >= 2 && tvb_get_ntohs(tvb, length) != 0x00FF) {
+ while (tvb_captured_length_remaining(tvb, length) >= 2 && tvb_get_ntohs(tvb, length) != 0x00FF) {
length += 1;
}
if (length) {
@@ -179,9 +179,9 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
}
length = 0;
- if (tvb_length_remaining(tvb, offset) == 1) {
+ if (tvb_captured_length_remaining(tvb, offset) == 1) {
length = 1;
- } else while (tvb_length_remaining(tvb, offset + length) >= 2 && tvb_get_ntohs(tvb, offset + length) != 0x00FF) {
+ } else while (tvb_captured_length_remaining(tvb, offset + length) >= 2 && tvb_get_ntohs(tvb, offset + length) != 0x00FF) {
length += 1;
}
if (length) {
@@ -189,9 +189,9 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
offset += length;
}
- if (tvb_length_remaining(tvb, offset)) {
- proto_tree_add_item(main_tree, hf_ignored, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ if (tvb_captured_length_remaining(tvb, offset)) {
+ proto_tree_add_item(main_tree, hf_ignored, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-rfid-pn532.c b/epan/dissectors/packet-rfid-pn532.c
index 6dc81c8e43..cae417763c 100644
--- a/epan/dissectors/packet-rfid-pn532.c
+++ b/epan/dissectors/packet-rfid-pn532.c
@@ -728,7 +728,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
if (command_data) {
- sub_item = proto_tree_add_uint(pn532_tree, hf_pn532_response_for, tvb, offset, tvb_length_remaining(tvb, offset), command_data->command_frame_number);
+ sub_item = proto_tree_add_uint(pn532_tree, hf_pn532_response_for, tvb, offset, tvb_captured_length_remaining(tvb, offset), command_data->command_frame_number);
PROTO_ITEM_SET_GENERATED(sub_item);
}
}
@@ -780,8 +780,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
- proto_tree_add_item(pn532_tree, hf_pn532_parameters, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_parameters, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -791,7 +791,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
else
test_number = -1; /* Force unknown test_numer */
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_parameters_length, tvb, offset, 1, ENC_NA);
offset += 1;
@@ -801,7 +801,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
offset += 1;
proto_tree_add_item(pn532_tree, hf_pn532_parameters_length, tvb, offset, 1, ENC_NA);
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
offset += 1;
proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, length, ENC_NA);
@@ -822,8 +822,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* Not possible; test 0x05 runs infinitely */
break;
default:
- proto_tree_add_item(pn532_tree, hf_pn532_parameters, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_parameters, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
}
break;
@@ -890,21 +890,21 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
case READ_REGISTER_REQ:
- while (tvb_length_remaining(tvb, offset) >= 2) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 2) {
proto_tree_add_item(pn532_tree, hf_pn532_register_address, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
break;
case READ_REGISTER_RSP:
- while (tvb_length_remaining(tvb, offset) >= 1) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_register_value, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
break;
case WRITE_REGISTER_REQ:
- while (tvb_length_remaining(tvb, offset) >= 3) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 3) {
proto_tree_add_item(pn532_tree, hf_pn532_register_address, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
@@ -979,7 +979,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(pn532_tree, hf_pn532_sam_timeout, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_sam_irq, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
@@ -1003,7 +1003,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(sub_tree, hf_pn532_wakeup_enable_int_0, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_generate_irq, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
@@ -1134,8 +1134,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
offset += 1;
break;
default:
- proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1187,8 +1187,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
if (value & 0x04) {
- proto_tree_add_item(pn532_tree, hf_pn532_gi, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_gi, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1235,7 +1235,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
switch(baudrate) {
case ISO_IEC_14443A_106:
- while (tvb_length_remaining(tvb, offset) >= 4) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 4) {
proto_tree_add_item(pn532_tree, hf_pn532_14443a_uid, tvb, 6, 4, ENC_BIG_ENDIAN);
offset += 4;
}
@@ -1251,7 +1251,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(pn532_tree, hf_pn532_afi, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_polling_method, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
@@ -1272,11 +1272,11 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
else
baudrate = -1; /* Force unknown baudrate... */
- sub_item = proto_tree_add_uint(pn532_tree, hf_pn532_BrTy, tvb, offset, tvb_length_remaining(tvb, offset), baudrate);
+ sub_item = proto_tree_add_uint(pn532_tree, hf_pn532_BrTy, tvb, offset, tvb_captured_length_remaining(tvb, offset), baudrate);
PROTO_ITEM_SET_GENERATED(sub_item);
for (item_value = 1; item_value <= value; item_value += 1) {
- sub_item = proto_tree_add_item(pn532_tree, hf_pn532_target, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
+ sub_item = proto_tree_add_item(pn532_tree, hf_pn532_target, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_pn532_target);
proto_item_append_text(sub_item, " %u/%u", item_value, value);
@@ -1298,7 +1298,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(sub_tree, hf_pn532_nfc_id_1, tvb, offset, length, ENC_NA);
offset += length;
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(sub_tree, hf_pn532_ats_length, tvb, offset, 1, ENC_BIG_ENDIAN);
length = tvb_get_guint8(tvb, offset);
offset += 1;
@@ -1321,10 +1321,10 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(sub_tree, hf_pn532_pad, tvb, offset, 8, ENC_NA);
offset += 8;
- if (tvb_length_remaining(tvb, offset) >= 2) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 2) {
proto_tree_add_item(sub_tree, hf_pn532_syst_code, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- } else if (tvb_length_remaining(tvb, offset) == 1) {
+ } else if (tvb_captured_length_remaining(tvb, offset) == 1) {
proto_tree_add_expert(pn532_tree, pinfo, &ei_unexpected_data, tvb, offset, 1);
offset += 1;
}
@@ -1348,8 +1348,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
offset += 4;
break;
default:
- proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
}
}
@@ -1371,8 +1371,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
if (value & 0x02) {
- proto_tree_add_item(pn532_tree, hf_pn532_gi, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_gi, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1424,7 +1424,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* Seems to work for payloads from LibNFC's "nfc-mfultralight" command */
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(sub_handles[SUB_MIFARE], next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
} else if (sub_selected == SUB_ISO7816) {
/* Seems to work for EMV payloads sent using TAMA shell scripts */
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -1432,10 +1432,10 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* Need to do this, for the ISO7816 dissector to work, it seems */
pinfo->p2p_dir = P2P_DIR_SENT;
call_dissector(sub_handles[SUB_ISO7816], next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
} else {
- proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1453,10 +1453,10 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* Need to do this, for the ISO7816 dissector to work, it seems */
pinfo->p2p_dir = P2P_DIR_RECV;
call_dissector(sub_handles[SUB_ISO7816], next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
} else {
- proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1473,8 +1473,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
} else {
/* NOTE: MiFare transmissions may identify as spurious FeliCa packets, in some cases */
- proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1492,8 +1492,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
} else {
/* NOTE: MiFare transmissions may identify as spurious FeliCa packets, in some cases */
- proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1528,7 +1528,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(sub_tree, hf_pn532_autopoll_type_baudrate_and_modulation, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- while (tvb_length_remaining(tvb, offset) >= 1) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 1) {
sub_item = proto_tree_add_item(pn532_tree, hf_pn532_autopoll_type, tvb, offset, 1, ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_item, ett_pn532_autopoll_type);
proto_tree_add_item(sub_tree, hf_pn532_autopoll_type_act, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1663,13 +1663,13 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(pn532_tree, hf_pn532_mode_framing_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- proto_tree_add_item(pn532_tree, hf_pn532_initiator_command, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_initiator_command, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_SET_GENERAL_BYTES_REQ:
- proto_tree_add_item(pn532_tree, hf_pn532_gt, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_gt, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_SET_GENERAL_BYTES_RSP:
@@ -1683,14 +1683,14 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case TG_GET_DATA_RSP:
offset = dissect_status(pn532_tree, tvb, offset);
- proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_SET_DATA_REQ:
case TG_SET_METADATA_REQ:
- proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_SET_DATA_RSP:
@@ -1705,13 +1705,13 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case TG_GET_INITIATOR_CMD_RSP:
offset = dissect_status(pn532_tree, tvb, offset);
- proto_tree_add_item(pn532_tree, hf_pn532_initiator_command, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_initiator_command, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_RESP_TO_INITIATOR_REQ:
- proto_tree_add_item(pn532_tree, hf_pn532_tg_response, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_tg_response, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_RESP_TO_INITIATOR_RSP:
@@ -1734,14 +1734,14 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
- proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
- proto_tree_add_expert(pn532_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
+ proto_tree_add_expert(pn532_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-rgmp.c b/epan/dissectors/packet-rgmp.c
index c1c925ba0f..10a3ab744f 100644
--- a/epan/dissectors/packet-rgmp.c
+++ b/epan/dissectors/packet-rgmp.c
@@ -68,7 +68,7 @@ dissect_rgmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int off
/* 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_rgmp, tvb, offset, -1, ENC_NA);
diff --git a/epan/dissectors/packet-rlc.c b/epan/dissectors/packet-rlc.c
index 993210b6cf..5865a50842 100644
--- a/epan/dissectors/packet-rlc.c
+++ b/epan/dissectors/packet-rlc.c
@@ -776,7 +776,7 @@ tree_add_li(enum rlc_mode mode, struct rlc_li *li, guint8 li_idx, guint8 hdr_off
}
if (li->len > 0) {
- if (li->li > tvb_length_remaining(tvb, hdr_offs)) return li_tree;
+ if (li->li > tvb_captured_length_remaining(tvb, hdr_offs)) return li_tree;
if (li->len > li->li) return li_tree;
ti = proto_tree_add_item(li_tree, hf_rlc_li_data, tvb, hdr_offs + li->li - li->len, li->len, ENC_NA);
PROTO_ITEM_SET_HIDDEN(ti);
@@ -1433,14 +1433,14 @@ rlc_decipher_tvb(tvbuff_t *tvb, packet_info *pinfo, guint32 counter, guint8 rbid
key_in = translate_hex_key(out); /*Translation*/
/*Location for decrypted data*/
- out = g_malloc( tvb_length(tvb) );
+ out = g_malloc( tvb_captured_length(tvb) );
/*Build data input but dont send the header*/
- for(i = 0; i< tvb_length(tvb)-header_size; i++ ){
+ for(i = 0; i< tvb_captured_length(tvb)-header_size; i++ ){
out[i+header_size] = tvb_get_guint8(tvb, header_size+i);
}
/*Call KASUMI confidentiality function, note that rbid is zero indxed*/
- f8( key_in, counter, rbid-1, dir, &out[header_size], (tvb_length(tvb)-header_size)*8 );
+ f8( key_in, counter, rbid-1, dir, &out[header_size], (tvb_captured_length(tvb)-header_size)*8 );
/*Restore header in tvb*/
for (i = 0; i < header_size; i++) {
@@ -1448,7 +1448,7 @@ rlc_decipher_tvb(tvbuff_t *tvb, packet_info *pinfo, guint32 counter, guint8 rbid
}
/*Create new tvb.*/
- t = tvb_new_real_data(out,tvb_length(tvb), tvb_reported_length(tvb));
+ t = tvb_new_real_data(out,tvb_captured_length(tvb), tvb_reported_length(tvb));
/*add_new_data_source(pinfo, tvb, "Data enciphered");*/
add_new_data_source(pinfo, t, "Deciphered data");
return t;
@@ -1640,9 +1640,9 @@ rlc_um_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo, proto_tree *tr
if ((!li_is_on_2_bytes && (li[i].li == 0x7f)) || (li[i].li == 0x7fff)) {
/* padding, must be last LI */
if (tree) {
- proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, tvb_length_remaining(tvb, offs), ENC_NA);
+ proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, tvb_captured_length_remaining(tvb, offs), ENC_NA);
}
- offs += tvb_length_remaining(tvb, offs);
+ offs += tvb_captured_length_remaining(tvb, offs);
} else if ((!li_is_on_2_bytes && (li[i].li == 0x7c)) || (li[i].li == 0x7ffc)) {
/* a new SDU starts here, mark this seq as the first PDU. */
struct rlc_channel ch_lookup;
@@ -1656,7 +1656,7 @@ rlc_um_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo, proto_tree *tr
} else if (li[i].li == 0x7ffa) {
/* the first data octet in this RLC PDU is the first octet of an RLC SDU
and the second last octet in this RLC PDU is the last octet of the same RLC SDU */
- length = tvb_length_remaining(tvb, offs);
+ length = tvb_captured_length_remaining(tvb, offs);
if (length > 1) {
length--;
if (tree && length) {
@@ -1690,13 +1690,13 @@ rlc_um_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo, proto_tree *tr
}
/* is there data left? */
- if (tvb_length_remaining(tvb, offs) > 0) {
+ if (tvb_captured_length_remaining(tvb, offs) > 0) {
if (tree) {
proto_tree_add_item(tree, hf_rlc_data, tvb, offs, -1, ENC_NA);
}
if (global_rlc_perform_reassemby) {
/* add remaining data as fragment */
- add_fragment(RLC_UM, tvb, pinfo, tree, offs, seq, i, tvb_length_remaining(tvb, offs), FALSE);
+ add_fragment(RLC_UM, tvb, pinfo, tree, offs, seq, i, tvb_captured_length_remaining(tvb, offs), FALSE);
if (dissected == FALSE)
col_set_str(pinfo->cinfo, COL_INFO, "[RLC UM Fragment]");
}
@@ -1738,7 +1738,7 @@ rlc_decode_li(enum rlc_mode mode, tvbuff_t *tvb, packet_info *pinfo, proto_tree
ext = next_bytes & 0x01;
hdr_len += li_on_2_bytes ? 2 : 1;
}
- total_len = tvb_length_remaining(tvb, hdr_len);
+ total_len = tvb_captured_length_remaining(tvb, hdr_len);
/* do actual evaluation of LIs */
ext = tvb_get_guint8(tvb, offs++) & 0x01;
@@ -1890,7 +1890,7 @@ dissect_rlc_um(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
if (global_rlc_li_size == RLC_LI_UPPERLAYER) {
if (rlcinf->li_size[pos] == RLC_LI_VARIABLE) {
- li_is_on_2_bytes = (tvb_length(tvb) > 125) ? TRUE : FALSE;
+ li_is_on_2_bytes = (tvb_captured_length(tvb) > 125) ? TRUE : FALSE;
} else {
li_is_on_2_bytes = (rlcinf->li_size[pos] == RLC_LI_15BITS) ? TRUE : FALSE;
}
@@ -1906,7 +1906,7 @@ dissect_rlc_um(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
if (global_rlc_headers_expected) {
/* There might not be any data, if only header was logged */
- is_truncated = (tvb_length_remaining(tvb, offs) == 0);
+ is_truncated = (tvb_captured_length_remaining(tvb, offs) == 0);
truncated_ti = proto_tree_add_boolean(tree, hf_rlc_header_only, tvb, 0, 0,
is_truncated);
if (is_truncated) {
@@ -1949,7 +1949,7 @@ dissect_rlc_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guin
bit_offset = offset*8 + 4; /* first SUFI type is always 4 bit shifted */
- while (!seen_last && tvb_length_remaining(tvb, bit_offset/8) > 0) {
+ while (!seen_last && tvb_captured_length_remaining(tvb, bit_offset/8) > 0) {
/* SUFI */
sufi_type = tvb_get_bits8(tvb, bit_offset, 4);
sufi_start_offset = bit_offset/8;
@@ -2184,7 +2184,7 @@ rlc_am_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo,
piggyback = TRUE;
} else if ((!li_is_on_2_bytes && (li[i].li == 0x7f)) || (li[i].li == 0x7fff)) {
/* padding, must be last LI */
- if (tvb_length_remaining(tvb, offs) > 0) {
+ if (tvb_captured_length_remaining(tvb, offs) > 0) {
if (tree) {
proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, -1, ENC_NA);
}
@@ -2193,7 +2193,7 @@ rlc_am_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo,
add_fragment(RLC_AM, tvb, pinfo, li[i].tree, offs, seq, i, 0, TRUE);
}
}
- offs += tvb_length_remaining(tvb, offs);
+ offs += tvb_captured_length_remaining(tvb, offs);
} else {
if (tree) {
proto_tree_add_item(tree, hf_rlc_data, tvb, offs, li[i].len, ENC_NA);
@@ -2214,14 +2214,14 @@ rlc_am_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo,
if (piggyback) {
dissect_rlc_status(tvb, pinfo, tree, offs);
} else {
- if (tvb_length_remaining(tvb, offs) > 0) {
+ if (tvb_captured_length_remaining(tvb, offs) > 0) {
/* we have remaining data, which we need to mark in the tree */
if (tree) {
proto_tree_add_item(tree, hf_rlc_data, tvb, offs, -1, ENC_NA);
}
if (global_rlc_perform_reassemby) {
add_fragment(RLC_AM, tvb, pinfo, tree, offs, seq, i,
- tvb_length_remaining(tvb,offs), final);
+ tvb_captured_length_remaining(tvb,offs), final);
if (final) {
next_tvb = get_reassembled_data(RLC_AM, tvb, pinfo, tree, seq, i);
}
@@ -2318,7 +2318,7 @@ dissect_rlc_am(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
if (global_rlc_li_size == RLC_LI_UPPERLAYER) {
if (rlcinf->li_size[pos] == RLC_LI_VARIABLE) {
- li_is_on_2_bytes = (tvb_length(tvb) > 126) ? TRUE : FALSE;
+ li_is_on_2_bytes = (tvb_captured_length(tvb) > 126) ? TRUE : FALSE;
} else {
li_is_on_2_bytes = (rlcinf->li_size[pos] == RLC_LI_15BITS) ? TRUE : FALSE;
}
@@ -2331,7 +2331,7 @@ dissect_rlc_am(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
offs += ((li_is_on_2_bytes) ? 2 : 1) * num_li;
if (global_rlc_headers_expected) {
/* There might not be any data, if only header was logged */
- is_truncated = (tvb_length_remaining(tvb, offs) == 0);
+ is_truncated = (tvb_captured_length_remaining(tvb, offs) == 0);
truncated_ti = proto_tree_add_boolean(tree, hf_rlc_header_only, tvb, 0, 0,
is_truncated);
if (is_truncated) {
@@ -2608,7 +2608,7 @@ dissect_rlc_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
- conditional header bytes
- tag for data
- at least one byte of RLC PDU payload */
- if (tvb_length_remaining(tvb, offset) < (gint)(strlen(RLC_START_STRING)+2+2)) {
+ if (tvb_captured_length_remaining(tvb, offset) < (gint)(strlen(RLC_START_STRING)+2+2)) {
return FALSE;
}
diff --git a/epan/dissectors/packet-rlm.c b/epan/dissectors/packet-rlm.c
index 193da875e1..88bb264ebf 100644
--- a/epan/dissectors/packet-rlm.c
+++ b/epan/dissectors/packet-rlm.c
@@ -132,7 +132,7 @@ dissect_rlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
rlm_type = tvb_get_guint8(tvb, 1);
/* we only know about version 2, and I've only seen 8 byte packets */
- if (tvb_length(tvb) != 8 || version != 2) {
+ if (tvb_captured_length(tvb) != 8 || version != 2) {
return FALSE;
}
diff --git a/epan/dissectors/packet-rlogin.c b/epan/dissectors/packet-rlogin.c
index b24112cfa4..1b921f86e6 100644
--- a/epan/dissectors/packet-rlogin.c
+++ b/epan/dissectors/packet-rlogin.c
@@ -122,7 +122,7 @@ rlogin_state_machine(rlogin_hash_entry_t *hash_info, tvbuff_t *tvb, packet_info
}
/* exit if no data */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length == 0)
{
return;
@@ -197,7 +197,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
rlogin_tree = proto_item_add_subtree(ti, ett_rlogin);
/* Return if data empty */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length == 0)
{
return;
@@ -261,7 +261,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
/* First frame of conversation, assume user info... */
- info_len = tvb_length_remaining(tvb, offset);
+ info_len = tvb_captured_length_remaining(tvb, offset);
if (info_len <= 0)
return;
@@ -421,7 +421,7 @@ dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
/* Work out packet content summary for display */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length != 0)
{
/* Initial NULL byte represents part of connection handshake */
@@ -452,7 +452,7 @@ dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
else
{
/* Show any text data in the frame */
- int bytes_to_copy = tvb_length(tvb);
+ int bytes_to_copy = tvb_captured_length(tvb);
if (bytes_to_copy > 128)
{
/* Truncate to 128 bytes for display */
@@ -473,7 +473,7 @@ dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
/* Dissect in detail */
rlogin_display(hash_info, tvb, pinfo, tree, tcpinfo);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-rmcp.c b/epan/dissectors/packet-rmcp.c
index 1928c90b90..671eeb5a7c 100644
--- a/epan/dissectors/packet-rmcp.c
+++ b/epan/dissectors/packet-rmcp.c
@@ -142,14 +142,14 @@ dissect_rmcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
if (!dissector_try_uint(rmcp_dissector_table, rmcp_class, next_tvb, pinfo,
tree)) {
len = call_dissector(data_handle, next_tvb, pinfo, tree);
- if (len < tvb_length(next_tvb)) {
+ if (len < tvb_captured_length(next_tvb)) {
proto_tree_add_text(tree, tvb, 4 + len, -1,
- "RSP Trailer (%d bytes):", tvb_length(next_tvb) - len);
+ "RSP Trailer (%d bytes):", tvb_captured_length(next_tvb) - len);
}
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -178,7 +178,7 @@ dissect_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
next_tvb = tvb_new_subset_remaining(tvb, 8);
dissect_rmcp(next_tvb, pinfo, tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-rnsap.c b/epan/dissectors/packet-rnsap.c
index af01e6b6e8..59784de19d 100644
--- a/epan/dissectors/packet-rnsap.c
+++ b/epan/dissectors/packet-rnsap.c
@@ -43106,35 +43106,35 @@ static int dissect_NULL_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tre
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(rnsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(rnsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(rnsap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(rnsap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c
index 7579a535b6..737306e10b 100644
--- a/epan/dissectors/packet-rohc.c
+++ b/epan/dissectors/packet-rohc.c
@@ -496,8 +496,8 @@ dissect_rohc_ext_format(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 t, r
offset++;
} else {
proto_tree_add_text(tree, tvb, offset, -1, "extension 3[Not dissected yet]");
- if (tvb_length_remaining(tvb, offset) > 0)
- offset += tvb_length_remaining(tvb, offset);
+ if (tvb_captured_length_remaining(tvb, offset) > 0)
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
}
@@ -1904,17 +1904,17 @@ dissect_rohc_ir_packet(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
switch(profile){
case ROHC_PROFILE_UNCOMPRESSED:
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
oct = tvb_get_guint8(tvb, offset);
if ( (oct&0xf0) == 0x60 ) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ipv6_handle, next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
else if ( (oct&0xf0) == 0x40 ) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ip_handle, next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "ROHC <");
col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
@@ -2071,7 +2071,7 @@ dissect_rohc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
memset(&g_rohc_info, 0, sizeof(rohc_info));
}
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
/* If this is ROHC ethertype clear col */
if ( pinfo->src.type == AT_ETHER ){
@@ -2159,7 +2159,7 @@ start_over:
p_rohc_info->last_created_item = proto_tree_add_item(rohc_tree, hf_rohc_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, "Error packet");
proto_tree_add_text(rohc_tree, tvb, offset, -1, "Error packet");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}else{
col_append_str(pinfo->cinfo, COL_INFO, "Feedback ");
/* 4) If the first remaining octet starts with 11110, and an Add-CID
@@ -2212,7 +2212,7 @@ start_over:
goto start_over;
proto_item_set_len(p_rohc_info->last_created_item, offset-feedback_start);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}/*feedback */
/* 5) If the first remaining octet starts with 1111111, this is a segment:
@@ -2225,7 +2225,7 @@ start_over:
PROTO_ITEM_SET_GENERATED(item);
}
proto_tree_add_text(rohc_tree, tvb, offset, -1, "Segment [Desegmentation not implemented yet]");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* 6) Here, it is known that the rest is forward information (unless the
* header is damaged).
@@ -2235,24 +2235,24 @@ start_over:
offset = dissect_rohc_ir_packet(tvb, rohc_tree, pinfo, offset, cid, is_add_cid, p_rohc_info);
if(offset == -1){
/* Could not parse header */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*proto_tree_add_text(rohc_tree, tvb, offset, -1, "Data");*/
payload_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(data_handle, payload_tvb, pinfo, rohc_tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if((oct&0xff) == 0xf8){
col_append_str(pinfo->cinfo, COL_INFO, "IR-DYN packet");
offset = dissect_rohc_ir_dyn_packet(tvb, rohc_tree, pinfo, offset, cid, is_add_cid, p_rohc_info);
if(offset == -1){
/* Could not parse header */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*proto_tree_add_text(rohc_tree, tvb, offset, -1, "Data");*/
payload_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(data_handle, payload_tvb, pinfo, rohc_tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if (!pinfo->fd->flags.visited){
@@ -2287,7 +2287,7 @@ start_over:
guint8 *payload_data;
gint len;
get_self_describing_var_len_val(tvb, rohc_tree, offset+1, hf_rohc_large_cid, &val_len);
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if (len >= val_len) {
len -= val_len;
payload_data = (guint8 *)wmem_alloc(pinfo->pool, len);
@@ -2311,7 +2311,7 @@ start_over:
}
col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "ROHC <");
col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
else if (((oct&0x80)==0x00) && (rohc_cid_context->profile==ROHC_PROFILE_RTP)) {
/* 5.7.1. Packet type 0: UO-0, R-0, R-0-CRC */
@@ -2345,7 +2345,7 @@ start_over:
payload_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(data_handle, payload_tvb, pinfo, tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Set up rohc_cid_hash which holds data for a CID
diff --git a/epan/dissectors/packet-ros.c b/epan/dissectors/packet-ros.c
index c26f07e835..bf286acd3d 100644
--- a/epan/dissectors/packet-ros.c
+++ b/epan/dissectors/packet-ros.c
@@ -264,7 +264,7 @@ call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
if(!ros_try_string(oid, next_tvb, pinfo, tree, session) &&
!dissector_try_string(ros_oid_dissector_table, oid, next_tvb, pinfo, tree, session)){
- proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "ROS: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
+ proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_captured_length_remaining(tvb, offset), "ROS: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
proto_tree *next_tree=proto_item_add_subtree(item, ett_ros_unknown);
expert_add_info_format(pinfo, item, &ei_ros_dissector_oid_not_implemented,
@@ -276,7 +276,7 @@ call_ros_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;
}
@@ -1068,7 +1068,7 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index 8b16754071..6fc3d84a98 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -588,7 +588,7 @@ dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
string_length = tvb_get_ntohl(tvb,offset);
data_offset = offset + 4;
}
- string_length_captured = tvb_length_remaining(tvb, data_offset);
+ string_length_captured = tvb_captured_length_remaining(tvb, data_offset);
string_length_packet = tvb_reported_length_remaining(tvb, data_offset);
string_length_full = rpc_roundup(string_length);
if (string_length_captured < string_length) {
@@ -606,7 +606,7 @@ dissect_rpc_opaque_data(tvbuff_t *tvb, int offset,
/* full string data */
string_length_copy = string_length;
fill_length = string_length_full - string_length;
- fill_length_captured = tvb_length_remaining(tvb,
+ fill_length_captured = tvb_captured_length_remaining(tvb,
data_offset + string_length);
fill_length_packet = tvb_reported_length_remaining(tvb,
data_offset + string_length);
@@ -1220,7 +1220,7 @@ dissect_rpc_authgss_token(tvbuff_t* tvb, proto_tree* tree, int offset,
offset += 4;
if (opaque_length != 0) {
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
reported_length = tvb_reported_length_remaining(tvb, offset);
DISSECTOR_ASSERT(length >= 0);
DISSECTOR_ASSERT(reported_length >= 0);
@@ -2728,7 +2728,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*
* Don't call any subdissector if we have no more date to dissect.
*/
- if (tvb_length_remaining(tvb, offset) == 0) {
+ if (tvb_captured_length_remaining(tvb, offset) == 0) {
return TRUE;
}
@@ -2805,7 +2805,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pinfo, ptree, 4,
dissect_function,
progname, rpc_call);
- offset = tvb_length(pinfo->gssapi_decrypted_tvb);
+ offset = tvb_captured_length(pinfo->gssapi_decrypted_tvb);
}
}
break;
@@ -2867,7 +2867,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
/*
* dissect any remaining bytes (incomplete dissection) as pure
* data in the ptree
@@ -2910,7 +2910,7 @@ dissect_rpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (!dissect_rpc_message(tvb, pinfo, tree, NULL, NULL, FALSE, 0,
TRUE)) {
- if (tvb_length(tvb) != 0)
+ if (tvb_captured_length(tvb) != 0)
dissect_rpc_continuation(tvb, pinfo, tree);
}
}
@@ -3135,7 +3135,7 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (len > max_rpc_tcp_pdu_size)
return 0; /* pretend it's not valid */
if (rpc_desegment) {
- seglen = tvb_length_remaining(tvb, offset + 4);
+ seglen = tvb_captured_length_remaining(tvb, offset + 4);
if ((gint)len > seglen && pinfo->can_desegment) {
/*
@@ -3174,7 +3174,7 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
}
len += 4; /* include record mark */
- tvb_len = tvb_length_remaining(tvb, offset);
+ tvb_len = tvb_captured_length_remaining(tvb, offset);
tvb_reported_len = tvb_reported_length_remaining(tvb, offset);
if (tvb_len > (gint)len)
tvb_len = len;
@@ -3751,7 +3751,7 @@ dissect_rpc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (dissect_rpc_tcp_common(tvb, pinfo, tree, FALSE, tcpinfo) == IS_NOT_RPC)
dissect_rpc_continuation(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Discard any state we've saved. */
diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c
index 7cfbbf3e70..ddfe08aef7 100644
--- a/epan/dissectors/packet-rpcap.c
+++ b/epan/dissectors/packet-rpcap.c
@@ -387,7 +387,7 @@ dissect_rpcap_error (tvbuff_t *tvb, packet_info *pinfo,
proto_item *ti;
gint len;
- len = tvb_length_remaining (tvb, offset);
+ len = tvb_captured_length_remaining (tvb, offset);
if (len <= 0)
return;
@@ -511,7 +511,7 @@ dissect_rpcap_findalldevs_if (tvbuff_t *tvb, packet_info *pinfo _U_,
for (i = 0; i < naddr; i++) {
offset = dissect_rpcap_findalldevs_ifaddr (tvb, pinfo, tree, offset);
- if (tvb_length_remaining (tvb, offset) < 0) {
+ if (tvb_captured_length_remaining (tvb, offset) < 0) {
/* No more data in packet */
expert_add_info(pinfo, ti, &ei_no_more_data);
break;
@@ -537,7 +537,7 @@ dissect_rpcap_findalldevs_reply (tvbuff_t *tvb, packet_info *pinfo _U_,
for (i = 0; i < no_devs; i++) {
offset = dissect_rpcap_findalldevs_if (tvb, pinfo, tree, offset);
- if (tvb_length_remaining (tvb, offset) < 0) {
+ if (tvb_captured_length_remaining (tvb, offset) < 0) {
/* No more data in packet */
expert_add_info(pinfo, ti, &ei_no_more_data);
break;
@@ -626,7 +626,7 @@ dissect_rpcap_filter (tvbuff_t *tvb, packet_info *pinfo,
for (i = 0; i < nitems; i++) {
offset = dissect_rpcap_filterbpf_insn (tvb, pinfo, tree, offset);
- if (tvb_length_remaining (tvb, offset) < 0) {
+ if (tvb_captured_length_remaining (tvb, offset) < 0) {
/* No more data in packet */
expert_add_info(pinfo, ti, &ei_no_more_data);
break;
@@ -686,7 +686,7 @@ dissect_rpcap_open_request (tvbuff_t *tvb, packet_info *pinfo _U_,
{
gint len;
- len = tvb_length_remaining (tvb, offset);
+ len = tvb_captured_length_remaining (tvb, offset);
proto_tree_add_item (parent_tree, hf_open_request, tvb, offset, len, ENC_ASCII|ENC_NA);
}
@@ -879,7 +879,7 @@ dissect_rpcap_packet (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree,
* reported_length_remaining should not be -1, as offset is at
* most right past the end of the available data in the packet.
*/
- reported_length_remaining = tvb_length_remaining (tvb, offset);
+ reported_length_remaining = tvb_captured_length_remaining (tvb, offset);
if (caplen > (guint)reported_length_remaining) {
expert_add_info(pinfo, ti, &ei_caplen_too_big);
return;
@@ -985,7 +985,7 @@ dissect_rpcap (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, void* da
dissect_rpcap_stats_reply (tvb, pinfo, tree, offset);
break;
default:
- len = tvb_length_remaining (tvb, offset);
+ len = tvb_captured_length_remaining (tvb, offset);
if (len) {
/* Yet unknown, dump as data */
proto_item_set_len (ti, 8);
@@ -995,7 +995,7 @@ dissect_rpcap (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, void* da
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1007,7 +1007,7 @@ check_rpcap_heur (tvbuff_t *tvb, gboolean tcp)
guint16 msg_value;
guint32 plen, len, caplen;
- if (tvb_length (tvb) < 8)
+ if (tvb_captured_length (tvb) < 8)
/* Too short */
return FALSE;
@@ -1041,7 +1041,7 @@ check_rpcap_heur (tvbuff_t *tvb, gboolean tcp)
plen = tvb_get_ntohl (tvb, offset);
offset += 4;
- len = (guint32) tvb_length_remaining (tvb, offset);
+ len = (guint32) tvb_captured_length_remaining (tvb, offset);
switch (msg_type) {
diff --git a/epan/dissectors/packet-rpki-rtr.c b/epan/dissectors/packet-rpki-rtr.c
index e3c27be8bc..0ef5d7e5a6 100644
--- a/epan/dissectors/packet-rpki-rtr.c
+++ b/epan/dissectors/packet-rpki-rtr.c
@@ -240,14 +240,14 @@ static int dissect_rpkirtr_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
dissect_rpkirtr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, 1, 8, get_rpkirtr_pdu_len, dissect_rpkirtr_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-rpl.c b/epan/dissectors/packet-rpl.c
index bbf7b93928..4303df1bed 100644
--- a/epan/dissectors/packet-rpl.c
+++ b/epan/dissectors/packet-rpl.c
@@ -143,7 +143,7 @@ dissect_rpl_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"Unknown Type"));
rpl_container_tree = proto_item_add_subtree(ti,
ett_type);
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length > sublen)
length = sublen;
reported_length = tvb_reported_length_remaining(tvb, offset);
diff --git a/epan/dissectors/packet-rrc.c b/epan/dissectors/packet-rrc.c
index 177ed17089..549ca960fd 100644
--- a/epan/dissectors/packet-rrc.c
+++ b/epan/dissectors/packet-rrc.c
@@ -16614,7 +16614,7 @@ dissect_rrc_NAS_SystemInformationGSM_MAP(tvbuff_t *tvb _U_, int offset _U_, asn1
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
1, 8, FALSE, &nas_sys_info_gsm_map_tvb);
- length = tvb_length(nas_sys_info_gsm_map_tvb);
+ length = tvb_captured_length(nas_sys_info_gsm_map_tvb);
if (length) {
if (actx->private_data) {
switch (GPOINTER_TO_UINT(actx->private_data)-1) {
@@ -56197,7 +56197,7 @@ dissect_rrc_T_single_GSM_Message_r3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
ett_rrc_T_single_GSM_Message_r3, T_single_GSM_Message_r3_sequence);
- bits_remaining = 8*tvb_length(tvb) - offset;
+ bits_remaining = 8*tvb_captured_length(tvb) - offset;
whole_octets_remaining = bits_remaining / 8;
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
@@ -56483,7 +56483,7 @@ dissect_rrc_T_single_GSM_Message_r6(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
ett_rrc_T_single_GSM_Message_r6, T_single_GSM_Message_r6_sequence);
- bits_remaining = 8*tvb_length(tvb) - offset;
+ bits_remaining = 8*tvb_captured_length(tvb) - offset;
whole_octets_remaining = bits_remaining / 8;
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
@@ -95975,7 +95975,7 @@ dissect_rrc_GSM_Classmark3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
1, 32, FALSE, &parameter_tvb);
if (parameter_tvb){
- de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
+ de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_captured_length(parameter_tvb), NULL, 0);
}
@@ -122473,7 +122473,7 @@ dissect_rrc_GSM_MS_RadioAccessCapability(tvbuff_t *tvb _U_, int offset _U_, asn1
1, 64, FALSE, &parameter_tvb);
if (parameter_tvb){
- de_gmm_ms_radio_acc_cap(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
+ de_gmm_ms_radio_acc_cap(parameter_tvb, tree, actx->pinfo, 0, tvb_captured_length(parameter_tvb), NULL, 0);
}
diff --git a/epan/dissectors/packet-rsh.c b/epan/dissectors/packet-rsh.c
index c5436229fe..2a1a76032c 100644
--- a/epan/dissectors/packet-rsh.c
+++ b/epan/dissectors/packet-rsh.c
@@ -231,12 +231,12 @@ dissect_rsh(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.
@@ -259,7 +259,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_CLIENT_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 */
@@ -287,7 +287,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_SERVER_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 password field */
@@ -317,7 +317,7 @@ dissect_rsh(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 */
@@ -340,7 +340,7 @@ dissect_rsh(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 == RSH_PORT){
/* Packet going to the server */
/* offset = 0 since the whole packet is data */
diff --git a/epan/dissectors/packet-rsl.c b/epan/dissectors/packet-rsl.c
index 6de3e48886..80d81ff737 100644
--- a/epan/dissectors/packet-rsl.c
+++ b/epan/dissectors/packet-rsl.c
@@ -3305,7 +3305,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Link Identifier 9.3.2 M TV 2 */
offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
/* L3 Information 9.3.11 O (note 1) TLV 3-23 */
- if (tvb_length_remaining(tvb,offset) >1)
+ if (tvb_captured_length_remaining(tvb,offset) >1)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE, L3_INF_OTHER);
break;
/* 8.3.7 RELEASE REQUEST */
@@ -3338,7 +3338,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Link Identifier 9.3.2 M TV 2 */
offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
/* L3 Information 9.3.11 O (note 1) TLV 3-23 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE, L3_INF_OTHER);
break;
/* Common Channel Management/TRX Management messages */
@@ -3349,10 +3349,10 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* System Info Type 9.3.30 M TV 2 */
offset = dissect_rsl_ie_sys_info_type(tvb, pinfo, tree, offset, TRUE, &sys_info_type);
/* Full BCCH Info (SYS INFO) 9.3.39 O 1) TLV 25 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_full_bcch_inf(tvb, pinfo, tree, offset, TRUE);
/* Starting Time 9.3.23 O 2) TV 3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_starting_time(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.5.2 CCCH LOAD INDICATION 18*/
@@ -3363,7 +3363,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* RACH Load 9.3.18 C 1) TLV >=8 */
offset = dissect_rsl_ie_rach_load(tvb, pinfo, tree, offset, FALSE);
/* Paging Load 9.3.15 C 2) TV 3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_paging_load(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.5.3 */
@@ -3375,7 +3375,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Access Delay 9.3.17 M TV 2 */
offset = dissect_rsl_ie_access_delay(tvb, pinfo, tree, offset, TRUE);
/* Physical Context 9.3.16 O 1) TLV >=2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_phy_ctx(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.5.4 DELETE INDICATION */
@@ -3393,10 +3393,10 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* MS Identity 9.3.12 M TLV 2-10 2 */
offset = dissect_rsl_ie_ms_id(tvb, pinfo, tree, offset, TRUE);
/* Channel Needed 9.3.40 O 1) TV 2 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ch_needed(tvb, pinfo, tree, offset, FALSE);
/* eMLPP Priority 9.3.49 O 2) TV 2 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_emlpp_prio(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.5.6 IMMEDIATE ASSIGN COMMAND */
@@ -3413,7 +3413,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* SMSCB Information 9.3.36 M TV 24 */
offset = dissect_rsl_ie_smscb_inf(tvb, pinfo, tree, offset, TRUE);
/* SMSCB Channel Indicator 9.3.44 O 1) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_smscb_ch_ind(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.6 TRX MANAGEMENT MESSAGES */
@@ -3427,11 +3427,11 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* System Info Type 9.3.30 M TV 2 */
offset = dissect_rsl_ie_sys_info_type(tvb, pinfo, tree, offset, TRUE, &sys_info_type);
/* L3 Info (SYS INFO) 9.3.11 O 1) TLV 22 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE,
(sys_info_type == 0x48) ? L3_INF_SACCH : L3_INF_OTHER);
/* Starting Time 9.3.23 O 2) TV 3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_starting_time(tvb, pinfo, tree, offset, FALSE);
break;
case RSL_MSG_OVERLOAD: /* 27 8.6.3 */
@@ -3442,16 +3442,16 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Cause 9.3.26 M TLV >=3 */
offset = dissect_rsl_ie_cause(tvb, pinfo, tree, offset, TRUE);
/* Message Identifier 9.3.28 O 1) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_message_id(tvb, pinfo, tree, offset, FALSE);
/* Channel Number 9.3.1 O 2) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
/* Link identifier 9.3.2 O 3) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
/* Erroneous Message 9.3.38 O 4) TLV >=3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_err_msg(tvb, pinfo, tree, offset, TRUE);
break;
/* 8.5.8 SMS BROADCAST COMMAND */
@@ -3463,7 +3463,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* SMSCB message 9.3.42 M TLV 2-90 */
offset = dissect_rsl_ie_smscb_mess(tvb, pinfo, tree, offset, TRUE);
/* SMSCB Channel Indicator 9.3.44 O 1) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_smscb_ch_ind(tvb, pinfo, tree, offset, FALSE);
break;
case RSL_MSG_CBCH_LOAD_IND: /* 30 8.5.9 */
@@ -3472,7 +3472,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* CBCH Load Information 9.3.43 M TV 2 */
offset = dissect_rsl_ie_cbch_load_inf(tvb, pinfo, tree, offset, TRUE);
/* SMSCB Channel Indicator 9.3.44 O 1) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_smscb_ch_ind(tvb, pinfo, tree, offset, FALSE);
break;
case RSL_MSG_NOT_CMD: /* 31 8.5.10 */
@@ -3481,13 +3481,13 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Command indicator 9.3.48 M 1) TLV 3-4 */
offset = dissect_rsl_ie_cmd_ind(tvb, pinfo, tree, offset, TRUE);
/* Group call reference 9.3.45 O TLV 7 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_grp_call_ref(tvb, pinfo, tree, offset, FALSE);
/* Channel Description 9.3.46 O TLV 3-n */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ch_desc(tvb, pinfo, tree, offset, FALSE);
/* NCH DRX information 9.3.47 O TLV 3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_nch_drx(tvb, pinfo, tree, offset, FALSE);
break;
@@ -3501,46 +3501,46 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Channel Mode 9.3.6 M TLV 8-9 */
offset = dissect_rsl_ie_ch_mode(tvb, pinfo, tree, offset, TRUE);
/* Channel Identification 9.3.5 O 7) TLV 8 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ch_id(tvb, pinfo, tree, offset, FALSE);
/* Encryption information 9.3.7 O 1) TLV >=3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_enc_inf(tvb, pinfo, tree, offset, FALSE);
/* Handover Reference 9.3.9 C 2) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ho_ref(tvb, pinfo, tree, offset, FALSE);
/* BS Power 9.3.4 O 3) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_bs_power(tvb, pinfo, tree, offset, FALSE);
/* MS Power 9.3.13 O 3) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ms_pow(tvb, pinfo, tree, offset, FALSE);
/* Timing Advance 9.3.24 C 3) 4) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_timing_adv(tvb, pinfo, tree, offset, FALSE);
/* BS Power Parameters 9.3.32 O 5) TLV >=2 */
/* MS Power Parameters 9.3.31 O 5) TLV >=2 */
/* Physical Context 9.3.16 O 6) TLV >=2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_phy_ctx(tvb, pinfo, tree, offset, FALSE);
/* SACCH Information 9.3.29 O 8) TLV >=3 */
/* UIC 9.3.50 O 9) TLV 3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_uic(tvb, pinfo, tree, offset, FALSE);
/* Main channel reference 9.3.51 O 10) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_main_ch_ref(tvb, pinfo, tree, offset, FALSE);
/* MultiRate configuration 9.3.52 O 11) TLV >=4 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, FALSE);
/* MultiRate Control 9.3.53 O 12) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_multirate_cntrl(tvb, pinfo, tree, offset, FALSE);
/* Supported Codec Types 9.3.54 O 12) TLV >=5 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_sup_codec_types(tvb, pinfo, tree, offset, FALSE);
/* TFO transparent container 9.3.59 O 12) TLV >=3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, FALSE);
break;
@@ -3586,7 +3586,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Channel number 9.3.1 M TV 2 */
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
/* Access Delay 9.3.17 O 1) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_access_delay(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.8 MEASUREMENT RESULT 40 */
@@ -3600,10 +3600,10 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* BS Power 9.3.4 M TV 2 */
offset = dissect_rsl_ie_bs_power(tvb, pinfo, tree, offset, TRUE);
/* L1 Information 9.3.10 O 1) TV 3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_l1_inf(tvb, pinfo, tree, offset, FALSE);
/* L3 Info (MEAS REP, EXT MEAS REP or ENH MEAS REP) 9.3.11 O 1) TLV 21 */
- if (tvb_length_remaining(tvb,offset) > 0){
+ if (tvb_captured_length_remaining(tvb,offset) > 0){
/* Try to figure out of we have (MEAS REP, EXT MEAS REP or ENH MEAS REP) */
if ( ( tvb_get_guint8(tvb, offset+3) & 0xFE ) == 0x10 ) {
/* ENH MEAS REP */
@@ -3613,7 +3613,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
}
}
/* MS Timing Offset 9.3.37 O 2) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ms_timing_offset(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.9 MODE MODIFY */
@@ -3623,22 +3623,22 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Channel Mode 9.3.6 M TLV 8-9 */
offset = dissect_rsl_ie_ch_mode(tvb, pinfo, tree, offset, TRUE);
/* Encryption information 9.3.7 O 1) TLV >=3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_enc_inf(tvb, pinfo, tree, offset, FALSE);
/* Main channel reference 9.3.45 O 2) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_main_ch_ref(tvb, pinfo, tree, offset, FALSE);
/* MultiRate configuration 9.3.52 O 3) TLV >=3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, FALSE);
/* Multirate Control 9.3.53 O 4) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_multirate_cntrl(tvb, pinfo, tree, offset, FALSE);
/* Supported Codec Types 9.3.54 O 4) TLV >=5 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_sup_codec_types(tvb, pinfo, tree, offset, FALSE);
/* TFO transparent container 9.3.59 O 4) TLV */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.10 MODE MODIFY ACKNOWLEDGE */
@@ -3669,7 +3669,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Timing Advance 9.3.24 M TV 2 */
offset = dissect_rsl_ie_timing_adv(tvb, pinfo, tree, offset, TRUE);
/* Physical Context 9.3.16 O 1) TLV */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_phy_ctx(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.14 RF CHANNEL RELEASE */
@@ -3682,7 +3682,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Channel number 9.3.1 M TV 2 */
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
/* MS Power 9.3.13 M TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ms_pow(tvb, pinfo, tree, offset, FALSE);
/* MS Power Parameters 9.3.31 O 1) TLV >=2 */
break;
@@ -3718,11 +3718,11 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* System Info Type 9.3.30 M TV 2 */
offset = dissect_rsl_ie_sys_info_type(tvb, pinfo, tree, offset, TRUE, &sys_info_type);
/* L3 Info 9.3.11 O 1) TLV 22 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE,
(sys_info_type == 0x48) ? L3_INF_SACCH : L3_INF_OTHER);
/* Starting Time 9.3.23 O 2) TV 3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_starting_time(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.21 TALKER DETECTION */
@@ -3730,7 +3730,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Channel number 9.3.1 M TV 2 */
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
/* Access Delay 9.3.17 O 1) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
break;
/* 8.4.22 LISTENER DETECTION */
@@ -3738,7 +3738,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Channel number 9.3.1 M TV 2 */
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
/* Access Delay 9.3.17 O 1) TV 2 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
break;
/* 8.4.23 REMOTE CODEC CONFIGURATION REPORT */
@@ -3748,10 +3748,10 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Codec Configuration 9.3.55 M TLV >=3 */
offset = dissect_rsl_ie_codec_conf(tvb, pinfo, tree, offset, TRUE);
/* Supported Codec Types 9.3.54 M TLV >=5 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_sup_codec_types(tvb, pinfo, tree, offset, FALSE);
/* TFO transparent container 9.3.59 O 4) TLV >=3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.24 ROUND TRIP DELAY REPORT */
@@ -3770,7 +3770,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Codec Configuration 9.3.55 M TLV >=3 */
offset = dissect_rsl_ie_codec_conf(tvb, pinfo, tree, offset, TRUE);
/* TFO transparent container 9.3.59 O 4) TLV >=3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.26 MULTIRATE CODEC MODIFICATION REQUEST */
@@ -3778,7 +3778,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Channel number 9.3.1 M TV 2 */
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
/* MultiRate Configuration 9.3.52 O 1) TLV >=4 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.27 MULTIRATE CODEC MODIFICATION ACKNOWLEDGE */
@@ -3786,7 +3786,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Channel number 9.3.1 M TV 2 */
offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE);
/* MultiRate Configuration 9.3.52 O 1) TLV >=4 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_multirate_conf(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.28 MULTIRATE CODEC MODIFICATION NEGATIVE ACKNOWLEDGE */
@@ -3817,10 +3817,10 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* MultiRateControl 9.3.53 M TV 2 */
offset = dissect_rsl_ie_multirate_cntrl(tvb, pinfo, tree, offset, TRUE);
/* Supported Codec Type 9.3.54 O 1) TLV >=5 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_sup_codec_types(tvb, pinfo, tree, offset, FALSE);
/* TFO transparent container 9.3.59 O 4) TLV >=3 */
- if (tvb_length_remaining(tvb,offset) > 0)
+ if (tvb_captured_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_tfo_transp_cont(tvb, pinfo, tree, offset, FALSE);
break;
/* 0 1 - - - - - - Location Services messages: */
diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c
index 0c4dc26ee3..276a698ffa 100644
--- a/epan/dissectors/packet-rsvp.c
+++ b/epan/dissectors/packet-rsvp.c
@@ -7017,7 +7017,7 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
cksum = tvb_get_ntohs(tvb, offset+2);
- if (!pinfo->fragmented && ((int) tvb_length(tvb) >= msg_length)) {
+ if (!pinfo->fragmented && ((int) tvb_captured_length(tvb) >= msg_length)) {
/* 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, msg_length);
@@ -7413,7 +7413,7 @@ dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP");
dissect_rsvp_common(tvb, pinfo, tree, FALSE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -7422,7 +7422,7 @@ dissect_rsvp_e2ei(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP-E2EI");
dissect_rsvp_common(tvb, pinfo, tree, TRUE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-rsync.c b/epan/dissectors/packet-rsync.c
index 9448d70f7e..fb5930f8f9 100644
--- a/epan/dissectors/packet-rsync.c
+++ b/epan/dissectors/packet-rsync.c
@@ -217,7 +217,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(rsync_tree, &hfi_rsync_module_list_string, tvb, offset, -1, ENC_ASCII|ENC_NA);
/* we need to check the end of the buffer for magic string */
- buff_length = tvb_length_remaining(tvb, offset);
+ buff_length = tvb_captured_length_remaining(tvb, offset);
if (buff_length > RSYNCD_EXIT_LEN &&
0 == tvb_strneql(tvb, buff_length-RSYNCD_EXIT_LEN-1, RSYNCD_EXIT, RSYNCD_EXIT_LEN)) {
/* that's all, folks */
@@ -260,7 +260,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation_data->client_state = RSYNC_COMMAND;
- if (tvb_length(tvb) == RSYNC_MODULE_LIST_QUERY_LEN &&
+ if (tvb_captured_length(tvb) == RSYNC_MODULE_LIST_QUERY_LEN &&
0 == tvb_strneql(tvb, offset, RSYNC_MODULE_LIST_QUERY, RSYNC_MODULE_LIST_QUERY_LEN)) {
conversation_data->server_state = RSYNC_MODULE_LIST;
} else {
@@ -294,7 +294,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Packet dissection routine called by tcp (& udp) when port 873 detected */
diff --git a/epan/dissectors/packet-rtacser.c b/epan/dissectors/packet-rtacser.c
index c986514c65..e50654e99c 100644
--- a/epan/dissectors/packet-rtacser.c
+++ b/epan/dissectors/packet-rtacser.c
@@ -274,7 +274,7 @@ dissect_rtacser_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static int
dissect_rtacser(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
/* Check for a RTAC Serial packet. It should be at least 12 bytes */
if(length < 12) {
@@ -284,7 +284,7 @@ dissect_rtacser(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
dissect_rtacser_data(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/******************************************************************************************************/
diff --git a/epan/dissectors/packet-rtcdc.c b/epan/dissectors/packet-rtcdc.c
index c710af6082..29175a0431 100644
--- a/epan/dissectors/packet-rtcdc.c
+++ b/epan/dissectors/packet-rtcdc.c
@@ -143,7 +143,7 @@ dissect_open_request_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
static void
dissect_open_response_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtcdc_tree, proto_item *rtcdc_item)
{
- if (tvb_length(tvb) > DATA_CHANNEL_RESPONSE_LENGTH) {
+ if (tvb_captured_length(tvb) > DATA_CHANNEL_RESPONSE_LENGTH) {
expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_message_too_long);
}
if (rtcdc_tree) {
@@ -159,7 +159,7 @@ dissect_open_response_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtc
static void
dissect_open_ack_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtcdc_tree _U_, proto_item *rtcdc_item)
{
- if (tvb_length(tvb) > DATA_CHANNEL_ACK_LENGTH) {
+ if (tvb_captured_length(tvb) > DATA_CHANNEL_ACK_LENGTH) {
expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_message_too_long);
}
return;
@@ -227,7 +227,7 @@ dissect_new_open_request_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
proto_tree_add_item(rtcdc_tree, hf_new_protocol_length, tvb, NEW_PROTOCOL_LENGTH_OFFSET, NEW_PROTOCOL_LENGTH_LENGTH, ENC_BIG_ENDIAN);
label_length = tvb_get_ntohs(tvb, NEW_LABEL_LENGTH_OFFSET);
protocol_length = tvb_get_ntohs(tvb, NEW_PROTOCOL_LENGTH_OFFSET);
- if (NEW_OPEN_REQUEST_HEADER_LENGTH + (guint)label_length + (guint)protocol_length != tvb_length(tvb)) {
+ if (NEW_OPEN_REQUEST_HEADER_LENGTH + (guint)label_length + (guint)protocol_length != tvb_captured_length(tvb)) {
expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_inconsistent_label_and_parameter_length);
}
proto_tree_add_item(rtcdc_tree, hf_new_label, tvb, NEW_LABEL_OFFSET, label_length, ENC_ASCII|ENC_NA);
@@ -268,7 +268,7 @@ dissect_rtcdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
expert_add_info(pinfo, msg_item, &ei_rtcdc_message_type_unknown);
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index dc8773c3e0..abc16a6a0b 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -1637,7 +1637,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree
next_tvb = tvb_new_subset_length(tvb, offset-8, app_length+4);
/* look for registered sub-dissectors */
if (dissector_try_string(rtcp_dissector_table, ascii_name, next_tvb, pinfo, tree, NULL)) {
- /* found subdissector - return tvb_length */
+ /* found subdissector - return tvb_captured_length */
offset += 4;
packet_len -= 4;
if ( padding ) {
@@ -2903,7 +2903,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
gboolean e_bit;
srtcp_info = p_conv_data->srtcp_info;
/* get the offset to the start of the SRTCP fields at the end of the packet */
- srtcp_offset = tvb_length_remaining(tvb, offset) - srtcp_info->auth_tag_len - srtcp_info->mki_len - 4;
+ srtcp_offset = tvb_captured_length_remaining(tvb, offset) - srtcp_info->auth_tag_len - srtcp_info->mki_len - 4;
/* It has been setup as SRTCP, but skip to the SRTCP E field at the end
to see if this particular packet is encrypted or not. The E bit is the MSB. */
srtcp_index = tvb_get_ntohl(tvb,srtcp_offset);
diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c
index 19470834cb..390c92faff 100644
--- a/epan/dissectors/packet-rtmpt.c
+++ b/epan/dissectors/packet-rtmpt.c
@@ -565,7 +565,7 @@ static gint
rtmpt_get_amf_length(tvbuff_t *tvb, gint offset)
{
guint8 iObjType;
- gint remain = tvb_length_remaining(tvb, offset);
+ gint remain = tvb_captured_length_remaining(tvb, offset);
guint32 depth = 0;
gint itemlen = 0;
gint rv = 0;
@@ -644,7 +644,7 @@ rtmpt_get_amf_length(tvbuff_t *tvb, gint offset)
static gchar *
rtmpt_get_amf_param(tvbuff_t *tvb, gint offset, gint param, const gchar *prop)
{
- guint32 remain = tvb_length_remaining(tvb, offset);
+ guint32 remain = tvb_captured_length_remaining(tvb, offset);
guint32 itemlen;
guint32 iStringLength;
@@ -698,7 +698,7 @@ rtmpt_get_amf_param(tvbuff_t *tvb, gint offset, gint param, const gchar *prop)
static guint32
rtmpt_get_amf_txid(tvbuff_t *tvb, gint offset)
{
- guint32 remain = tvb_length_remaining(tvb, offset);
+ guint32 remain = tvb_captured_length_remaining(tvb, offset);
if (remain > 0) {
guint32 itemlen = rtmpt_get_amf_length(tvb, offset);
@@ -1118,7 +1118,7 @@ dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean *
* If we can't determine the length, don't carry on;
* just skip to the end of the tvbuff.
*/
- iValueOffset = tvb_length(tvb);
+ iValueOffset = tvb_captured_length(tvb);
break;
}
proto_item_set_end(ti, tvb, iValueOffset);
@@ -1557,7 +1557,7 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
* If we can't determine the length, don't carry on;
* just skip to the end of the tvbuff.
*/
- iValueOffset = tvb_length(tvb);
+ iValueOffset = tvb_captured_length(tvb);
break;
}
proto_item_set_end(ti, tvb, iValueOffset);
@@ -1639,7 +1639,7 @@ dissect_rtmpt_body_aggregate(tvbuff_t *tvb, gint offset, proto_tree *rtmpt_tree)
proto_item *data_item = NULL;
proto_tree *data_tree = NULL;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
guint8 iTagType;
guint iDataSize;
@@ -1697,22 +1697,22 @@ dissect_rtmpt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_conv_t
RTMPT_DEBUG("Dissect: frame=%u visited=%d len=%d tree=%p\n",
pinfo->fd->num, pinfo->fd->flags.visited,
- tvb_length_remaining(tvb, offset), tree);
+ tvb_captured_length_remaining(tvb, offset), tree);
/* Clear any previous data in Info column (RTMP packets are protected by a "fence") */
col_clear(pinfo->cinfo, COL_INFO);
- if (tvb_length_remaining(tvb, offset) < 1) return;
+ if (tvb_captured_length_remaining(tvb, offset) < 1) return;
if (tp->id <= RTMPT_ID_MAX) {
if (tp->fmt < 3
- && tvb_length_remaining(tvb, offset) >= tp->bhlen+3
+ && tvb_captured_length_remaining(tvb, offset) >= tp->bhlen+3
&& tvb_get_ntoh24(tvb, offset+tp->bhlen) == 0xffffff) {
haveETS = TRUE;
}
iBodyOffset = offset + tp->bhlen + tp->mhlen;
- iBodyRemain = tvb_length_remaining(tvb, iBodyOffset);
+ iBodyRemain = tvb_captured_length_remaining(tvb, iBodyOffset);
if (tp->cmd == RTMPT_TYPE_CHUNK_SIZE && tp->len >= 4 && iBodyRemain >= 4) {
guint32 newchunksize = tvb_get_ntohl(tvb, iBodyOffset);
@@ -1893,7 +1893,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
rtmpt_packet_t *tp;
tvbuff_t *pktbuf;
- remain = tvb_length(tvb);
+ remain = tvb_captured_length(tvb);
if (!remain)
return;
@@ -2322,7 +2322,7 @@ dissect_rtmpt_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
conv->key_ptr->port2 == pinfo->destport) ? 0 : 1;
dissect_rtmpt_common(tvb, pinfo, tree, rconv, cdir, tcpinfo->seq, tcpinfo->lastackseq);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -2337,7 +2337,7 @@ dissect_rtmpt_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint remain;
offset = 0;
- remain = tvb_length_remaining(tvb, 0);
+ remain = tvb_captured_length_remaining(tvb, 0);
/*
* Request flow:
@@ -2447,7 +2447,7 @@ static gboolean
dissect_rtmpt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *conversation;
- if (tvb_length(tvb) >= 12)
+ if (tvb_captured_length(tvb) >= 12)
{
/* To avoid a too high rate of false positive, this heuristics only matches the protocol
from the first server response packet and not from the client request packets before.
diff --git a/epan/dissectors/packet-rtpproxy.c b/epan/dissectors/packet-rtpproxy.c
index c0b60ebfb4..a92b27e59b 100644
--- a/epan/dissectors/packet-rtpproxy.c
+++ b/epan/dissectors/packet-rtpproxy.c
@@ -854,7 +854,7 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (has_lf)
proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_lf, tvb, realsize, 1, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-rtse.c b/epan/dissectors/packet-rtse.c
index f2055af6a3..fb9cfe026a 100644
--- a/epan/dissectors/packet-rtse.c
+++ b/epan/dissectors/packet-rtse.c
@@ -197,7 +197,7 @@ call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *
next_tvb = tvb_new_subset_remaining(tvb, offset);
if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, data)){
- proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
+ proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_captured_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
proto_tree *next_tree=proto_item_add_subtree(item, ett_rtse_unknown);
expert_add_info_format(pinfo, item, &ei_rtse_dissector_oid_not_implemented,
@@ -209,7 +209,7 @@ call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *
* 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;
}
@@ -308,7 +308,7 @@ dissect_rtse_T_t61String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
&string);
if(open_request && string)
- col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_captured_length(string)));
@@ -325,7 +325,7 @@ dissect_rtse_T_octetString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
&string);
if(open_request && string)
- col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_captured_length(string)));
@@ -363,7 +363,7 @@ dissect_rtse_CommonReference(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index);
if(open_request && string)
- col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_captured_length(string)));
@@ -791,7 +791,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, offset, hf_rtse_segment_data, &data_tvb);
if (data_tvb) {
- fragment_length = tvb_length_remaining (data_tvb, 0);
+ fragment_length = tvb_captured_length_remaining (data_tvb, 0);
proto_item_append_text(asn1_ctx.created_item, " (%u byte%s)", fragment_length,
plurality(fragment_length, "", "s"));
frag_msg = fragment_add_seq_next (&rtse_reassembly_table,
@@ -806,7 +806,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
pinfo->fragmented = TRUE;
data_handled = TRUE;
} else {
- fragment_length = tvb_length_remaining (tvb, offset);
+ fragment_length = tvb_captured_length_remaining (tvb, offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "[RTSE fragment, %u byte%s]",
@@ -820,7 +820,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
/* Return other than 0 to indicate that we handled this packet */
return 1;
} else {
- offset = tvb_length (tvb);
+ offset = tvb_captured_length (tvb);
}
pinfo->fragmented = FALSE;
data_handled = TRUE;
@@ -842,7 +842,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
top_tree = NULL;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void rtse_reassemble_init (void)
diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c
index f177115d91..415c99b848 100644
--- a/epan/dissectors/packet-rtsp.c
+++ b/epan/dissectors/packet-rtsp.c
@@ -1154,7 +1154,7 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo,
* was supplied), the amount of data to be processed is the amount
* of data remaining in the frame.
*/
- datalen = tvb_length_remaining(tvb, offset);
+ datalen = tvb_captured_length_remaining(tvb, offset);
reported_datalen = tvb_reported_length_remaining(tvb, offset);
if (content_length != -1) {
/*
diff --git a/epan/dissectors/packet-rua.c b/epan/dissectors/packet-rua.c
index 0634596b50..47229308f8 100644
--- a/epan/dissectors/packet-rua.c
+++ b/epan/dissectors/packet-rua.c
@@ -835,7 +835,7 @@ dissect_rua_RANAP_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &ranap_message_tvb);
- if ((tvb_length(ranap_message_tvb)>0)&&(ranap_handle)) { /* RUA has a RANAP-PDU */
+ if ((tvb_captured_length(ranap_message_tvb)>0)&&(ranap_handle)) { /* RUA has a RANAP-PDU */
col_set_str(actx->pinfo->cinfo, COL_INFO,
"(RUA) "); /* Set info to (RUA) to make room for RANAP */
col_set_fence(actx->pinfo->cinfo, COL_INFO);
@@ -1361,27 +1361,27 @@ static void dissect_RUA_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/epan/dissectors/packet-rudp.c b/epan/dissectors/packet-rudp.c
index 549a6d07b1..698551e8fd 100644
--- a/epan/dissectors/packet-rudp.c
+++ b/epan/dissectors/packet-rudp.c
@@ -136,7 +136,7 @@ dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
}
next_tvb = tvb_new_subset_remaining(tvb, hlen);
- if (tvb_length(next_tvb) && sm_handle)
+ if (tvb_captured_length(next_tvb) && sm_handle)
call_dissector(sm_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-rx.c b/epan/dissectors/packet-rx.c
index 74ddd5968b..23ea1f7c1d 100644
--- a/epan/dissectors/packet-rx.c
+++ b/epan/dissectors/packet-rx.c
@@ -380,7 +380,7 @@ dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
* any sort of documentation other than "read the source of any of the
* (compatible?) implementations.
*/
- if (tvb_length_remaining(tvb, offset)>3) {
+ if (tvb_captured_length_remaining(tvb, offset)>3) {
offset += 3; /* guess. some implementations adds 3 bytes */
if (tvb_reported_length_remaining(tvb, offset) >= 4){
@@ -452,7 +452,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *dat
guint16 serviceid;
/* Ensure we have enough data */
- if (tvb_length(tvb) < 28)
+ if (tvb_captured_length(tvb) < 28)
return 0;
/* Make sure it's a known type */
@@ -572,7 +572,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *dat
break;
}
- return(tvb_length(tvb));
+ return(tvb_captured_length(tvb));
}
void
diff --git a/epan/dissectors/packet-s1ap.c b/epan/dissectors/packet-s1ap.c
index dd5aeaa483..457865de28 100644
--- a/epan/dissectors/packet-s1ap.c
+++ b/epan/dissectors/packet-s1ap.c
@@ -1720,7 +1720,7 @@ dissect_s1ap_PLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
3, 3, FALSE, &parameter_tvb);
- if(tvb_length(tvb)==0)
+ if(tvb_captured_length(tvb)==0)
return offset;
if (!parameter_tvb)
@@ -3339,7 +3339,7 @@ dissect_s1ap_ENBname(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr
if (!parameter_tvb)
return offset;
- length = tvb_length(parameter_tvb);
+ length = tvb_captured_length(parameter_tvb);
is_ascii = TRUE;
for (p_offset=0; p_offset < length; p_offset++){
@@ -3372,7 +3372,7 @@ dissect_s1ap_TransportLayerAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
return offset;
/* Get the length */
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_TransportLayerAddress);
if (tvb_len==4){
/* IPv4 */
@@ -4059,7 +4059,7 @@ dissect_s1ap_LPPa_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, p
NO_BOUND, NO_BOUND, FALSE, &parameter_tvb);
- if ((tvb_length(parameter_tvb)>0)&&(lppa_handle))
+ if ((tvb_captured_length(parameter_tvb)>0)&&(lppa_handle))
call_dissector(lppa_handle, parameter_tvb, actx->pinfo, tree);
@@ -4452,7 +4452,7 @@ dissect_s1ap_NAS_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr
NO_BOUND, NO_BOUND, FALSE, &parameter_tvb);
- if ((tvb_length(parameter_tvb)>0)&&(nas_eps_handle))
+ if ((tvb_captured_length(parameter_tvb)>0)&&(nas_eps_handle))
call_dissector(nas_eps_handle,parameter_tvb,actx->pinfo, tree);
@@ -4676,7 +4676,7 @@ dissect_s1ap_RIMInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_s1ap_RIMInformation);
- if ((tvb_length(parameter_tvb)>0)&&(bssgp_handle)){
+ if ((tvb_captured_length(parameter_tvb)>0)&&(bssgp_handle)){
col_set_fence(actx->pinfo->cinfo, COL_INFO);
call_dissector(bssgp_handle,parameter_tvb,actx->pinfo, subtree);
}
@@ -5041,7 +5041,7 @@ dissect_s1ap_Source_ToTarget_TransparentContainer(tvbuff_t *tvb _U_, int offset
Source BSS to Target BSS
Transparent Container 48.018
*/
- de_bssgp_source_BSS_to_target_BSS_transp_cont(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
+ de_bssgp_source_BSS_to_target_BSS_transp_cont(parameter_tvb, subtree, actx->pinfo, 0, tvb_captured_length(parameter_tvb), NULL, 0);
break;
case 3:
/* utrantolte */
@@ -5394,7 +5394,7 @@ dissect_s1ap_Target_ToSource_TransparentContainer(tvbuff_t *tvb _U_, int offset
Target BSS to Source BSS
Transparent Container 48.018
*/
- de_bssgp_target_BSS_to_source_BSS_transp_cont(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
+ de_bssgp_target_BSS_to_source_BSS_transp_cont(parameter_tvb, subtree, actx->pinfo, 0, tvb_captured_length(parameter_tvb), NULL, 0);
break;
case 3:
@@ -10041,38 +10041,38 @@ int dissect_s1ap_SONtransferCause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
/* Currently not used
static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- return (dissector_try_uint(s1ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- return (dissector_try_uint(s1ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
*/
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
diff --git a/epan/dissectors/packet-s5066dts.c b/epan/dissectors/packet-s5066dts.c
index 188adfb6c5..c2a1b0f5b4 100644
--- a/epan/dissectors/packet-s5066dts.c
+++ b/epan/dissectors/packet-s5066dts.c
@@ -897,12 +897,12 @@ static int dissect_s5066dts(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_s5066dts_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- guint b_length = tvb_length(tvb);
+ guint b_length = tvb_captured_length(tvb);
/* Make sure there are enough bytes for a DPDU */
if ( b_length < S5066_DPDU_FRAME_HEADER_LEN){
@@ -925,7 +925,7 @@ static int dissect_s5066dts_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
static int dissect_s5066dts_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- guint b_length = tvb_length(tvb);
+ guint b_length = tvb_captured_length(tvb);
/* Make sure there are enough bytes for a DPDU */
if ( b_length < S5066_DPDU_FRAME_HEADER_LEN){
diff --git a/epan/dissectors/packet-s5066sis.c b/epan/dissectors/packet-s5066sis.c
index 832a027a75..92b911b322 100644
--- a/epan/dissectors/packet-s5066sis.c
+++ b/epan/dissectors/packet-s5066sis.c
@@ -1270,7 +1270,7 @@ static int
dissect_s5066_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
/* Make sure there are enough bytes... */
- if (tvb_length(tvb) < 5)
+ if (tvb_captured_length(tvb) < 5)
return 0;
/* Check if the first two bytes are 0x90 0xEB: if not,
then this is not a S5066 PDU or an unreassembled one.
@@ -1281,7 +1281,7 @@ dissect_s5066_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
return 0;
}
tcp_dissect_pdus(tvb, pinfo, tree, s5066_desegment, s5066_header_size, get_s5066_pdu_len, dissect_s5066_common, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1352,10 +1352,10 @@ dissect_s5066_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
/* Call sub dissector(s) */
reported_length = pdu_size - offset;
- available_length = tvb_length(tvb) - offset;
+ available_length = tvb_captured_length(tvb) - offset;
next_tvb = tvb_new_subset(tvb, offset, MIN(available_length, reported_length), reported_length);
call_dissector(data_handle, next_tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-sabp.c b/epan/dissectors/packet-sabp.c
index 1f714c6ba2..2a8a1c6c2f 100644
--- a/epan/dissectors/packet-sabp.c
+++ b/epan/dissectors/packet-sabp.c
@@ -1732,27 +1732,27 @@ static int dissect_SABP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
@@ -1789,7 +1789,7 @@ dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
cb_inf_msg_len = tvb_get_guint8(tvb,offset+82);
page_tvb = tvb_new_subset_length(tvb, offset, cb_inf_msg_len);
unpacked_tvb = dissect_cbs_data(sms_encoding, page_tvb, subtree, pinfo, 0);
- len = tvb_length(unpacked_tvb);
+ len = tvb_captured_length(unpacked_tvb);
if (unpacked_tvb != NULL){
if (tree != NULL){
proto_tree *cbs_page_subtree = proto_item_add_subtree(cbs_page_item, ett_sabp_cbs_page_content);
@@ -1846,7 +1846,7 @@ dissect_sabp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
sabp_tree = proto_item_add_subtree(sabp_item, ett_sabp);
dissect_SABP_PDU_PDU(tvb, pinfo, sabp_tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Note a little bit of a hack assumes length max takes two bytes and that the length starts at byte 4 */
@@ -1855,7 +1855,7 @@ dissect_sabp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
{
tcp_dissect_pdus(tvb, pinfo, tree, gbl_sabp_desegment, 5,
get_sabp_pdu_len, dissect_sabp, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_sabp -------------------------------------------*/
diff --git a/epan/dissectors/packet-sametime.c b/epan/dissectors/packet-sametime.c
index 3cbe51291d..0256c34d64 100644
--- a/epan/dissectors/packet-sametime.c
+++ b/epan/dissectors/packet-sametime.c
@@ -624,7 +624,7 @@ dissect_sametime_content(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
}
tap_queue_packet(sametime_tap, pinfo, sinfo);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -673,7 +673,7 @@ get_sametime_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
/* because tcp_dissect_pdus was called with 4 as a required "fixed length". */
/* But newer variants of this protocol with a full encrypted network stream */
/* may require a more sophisticated dissection logic here */
- guint32 N = tvb_length_remaining(tvb, offset);
+ guint32 N = tvb_captured_length_remaining(tvb, offset);
return (N < 4) ? N : tvb_get_ntohl(tvb, offset) + 4;
}
@@ -690,7 +690,7 @@ dissect_sametime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
tcp_dissect_pdus(tvb, pinfo, tree, global_sametime_reassemble_packets, 4,
get_sametime_message_len, dissect_sametime_content, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-sap.c b/epan/dissectors/packet-sap.c
index 7d791b0c88..1d88cba375 100644
--- a/epan/dissectors/packet-sap.c
+++ b/epan/dissectors/packet-sap.c
@@ -235,7 +235,7 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int pt_string_len;
guint8* pt_str;
- remaining_len = tvb_length_remaining(tvb, offset);
+ remaining_len = tvb_captured_length_remaining(tvb, offset);
if (remaining_len == 0) {
/*
* "tvb_strneql()" failed because there was no
diff --git a/epan/dissectors/packet-sasp.c b/epan/dissectors/packet-sasp.c
index 6ac2eaf07b..78a7f996d5 100644
--- a/epan/dissectors/packet-sasp.c
+++ b/epan/dissectors/packet-sasp.c
@@ -358,7 +358,7 @@ dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
"Invalid SASP Header Type [0x%04x]", hdr_type);
/* XXX: The folowing should actually happen automatically ? */
col_set_str(pinfo->cinfo, COL_INFO, "[Malformed: Invalid SASP Header Type]");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
offset += 2;
@@ -463,7 +463,7 @@ dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
"Unknown SASP Message Type: 0x%4x", msg_type);
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -472,7 +472,7 @@ dissect_sasp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, sasp_desegment, SASP_MIN_PACKET_LEN, get_sasp_pdu_len,
dissect_sasp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-sbc-ap.c b/epan/dissectors/packet-sbc-ap.c
index 09358e099a..f17c73d128 100644
--- a/epan/dissectors/packet-sbc-ap.c
+++ b/epan/dissectors/packet-sbc-ap.c
@@ -558,7 +558,7 @@ dissect_sbc_ap_PLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
3, 3, FALSE, &parameter_tvb);
- if(tvb_length(tvb)==0)
+ if(tvb_captured_length(tvb)==0)
return offset;
if (!parameter_tvb)
@@ -1133,38 +1133,38 @@ static int dissect_SBC_AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
/* Currently not used
static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
*/
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
diff --git a/epan/dissectors/packet-sbc.c b/epan/dissectors/packet-sbc.c
index e23765094f..37b6d99ab6 100644
--- a/epan/dissectors/packet-sbc.c
+++ b/epan/dissectors/packet-sbc.c
@@ -153,7 +153,7 @@ dissect_sbc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
number_of_frames = tvb_get_guint8(tvb, offset) & 0x0F;
offset += 1;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
byte = tvb_get_guint8(tvb, offset + 1);
frequency = (byte & 0xC0) >> 6;
blocks = (byte & 0x30) >> 4;
diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c
index 6ffa97f0c3..008e7492a8 100644
--- a/epan/dissectors/packet-sbus.c
+++ b/epan/dissectors/packet-sbus.c
@@ -607,7 +607,7 @@ is_sbus_pdu(tvbuff_t *tvb)
/* we need at least 8 bytes to determine whether this is sbus or
not*/
- if(tvb_length(tvb)<8){
+ if(tvb_captured_length(tvb)<8){
return FALSE;
}
diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c
index ce912feb99..efe8ac10a4 100644
--- a/epan/dissectors/packet-sccp.c
+++ b/epan/dissectors/packet-sccp.c
@@ -842,7 +842,7 @@ sccp_called_calling_looks_valid(guint32 frame_num _U_, tvbuff_t *tvb, guint8 my_
{
guint8 ai, ri, gti, ssni, pci;
guint8 len_needed = 1; /* need at least the Address Indicator */
- guint len = tvb_length(tvb);
+ guint len = tvb_captured_length(tvb);
ai = tvb_get_guint8(tvb, 0);
if ((my_mtp3_standard == ANSI_STANDARD) && ((ai & ANSI_NATIONAL_MASK) == 0))
@@ -908,7 +908,7 @@ looks_like_valid_sccp(guint32 frame_num _U_, tvbuff_t *tvb, guint8 my_mtp3_stand
guint data_ptr = 0;
guint opt_ptr = 0;
guint8 pointer_length = POINTER_LENGTH;
- guint len = tvb_length(tvb);
+ guint len = tvb_captured_length(tvb);
/* Ensure we can do some basic checks without throwing an exception.
* Accesses beyond this length need to check the length first because
@@ -1570,7 +1570,7 @@ dissect_sccp_unknown_message(tvbuff_t *message_tvb, proto_tree *sccp_tree)
{
guint32 message_length;
- message_length = tvb_length(message_tvb);
+ message_length = tvb_captured_length(message_tvb);
proto_tree_add_text(sccp_tree, message_tvb, 0, message_length,
"Unknown message (%u byte%s)",
diff --git a/epan/dissectors/packet-sccpmg.c b/epan/dissectors/packet-sccpmg.c
index 08df987828..f17ea1af83 100644
--- a/epan/dissectors/packet-sccpmg.c
+++ b/epan/dissectors/packet-sccpmg.c
@@ -127,7 +127,7 @@ dissect_sccpmg_unknown_message(tvbuff_t *message_tvb, proto_tree *sccpmg_tree)
{
guint32 message_length;
- message_length = tvb_length(message_tvb);
+ message_length = tvb_captured_length(message_tvb);
proto_tree_add_text(sccpmg_tree, message_tvb, 0, message_length,
"Unknown message (%u byte%s)", message_length,
diff --git a/epan/dissectors/packet-scop.c b/epan/dissectors/packet-scop.c
index be254cdf49..90a0a37016 100644
--- a/epan/dissectors/packet-scop.c
+++ b/epan/dissectors/packet-scop.c
@@ -157,7 +157,7 @@ dissect_scop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
col_clear(pinfo->cinfo, COL_INFO);
/* Create the protocol display tree. */
- proto_root = proto_tree_add_protocol_format(tree, proto_scop, tvb, 0, tvb_length(tvb),
+ proto_root = proto_tree_add_protocol_format(tree, proto_scop, tvb, 0, tvb_captured_length(tvb),
"ZigBee SCoP");
scop_tree = proto_item_add_subtree(proto_root, ett_scop);
@@ -204,7 +204,7 @@ dissect_scop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_scop() */
/*FUNCTION:------------------------------------------------------
@@ -249,7 +249,7 @@ static int
dissect_scop_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, SCOP_HEADER_LENGTH, get_scop_length, dissect_scop, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_scop_tcp */
@@ -286,7 +286,7 @@ dissect_scop_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* If there are any bytes left over, pass them to the data dissector. */
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
tvbuff_t *payload_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree *root = proto_tree_get_root(tree);
call_dissector(data_handle, payload_tvb, pinfo, root);
diff --git a/epan/dissectors/packet-scsi-osd.c b/epan/dissectors/packet-scsi-osd.c
index 73a71fd2aa..7331e46a1e 100644
--- a/epan/dissectors/packet-scsi-osd.c
+++ b/epan/dissectors/packet-scsi-osd.c
@@ -514,7 +514,7 @@ dissect_osd_attributes_list(packet_info *pinfo, tvbuff_t *tvb, int offset,
* all remaining bytes. 7.1.3.1
*/
if (!osd2 && type == 1) {
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
}
length += (osd2?8:4);
@@ -1610,7 +1610,7 @@ dissect_osd_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info);
allocation_length = cdata->itlq->alloc_len;
- remaining_length = tvb_length_remaining(tvb, offset);
+ remaining_length = tvb_captured_length_remaining(tvb, offset);
if (remaining_length<allocation_length) allocation_length = remaining_length;
if (allocation_length<24) return;
@@ -3159,7 +3159,7 @@ dissect_osd2_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_osd_attribute_data_in(pinfo, tvb, offset, tree, cdata, lun_info);
allocation_length = cdata->itlq->alloc_len;
- remaining_length = tvb_length_remaining(tvb, offset);
+ remaining_length = tvb_captured_length_remaining(tvb, offset);
if (remaining_length<allocation_length) allocation_length = remaining_length;
if (allocation_length<12) return;
diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c
index 1b1cc514b9..f6fdb637f9 100644
--- a/epan/dissectors/packet-scsi.c
+++ b/epan/dissectors/packet-scsi.c
@@ -3082,7 +3082,7 @@ dissect_spc_inquiry(tvbuff_t *tvb_a, packet_info *pinfo,
};
if (!isreq && ((cdata == NULL) || !(cdata->itlq->flags & 0x3))
- && (tvb_length_remaining(tvb_a, offset_a) >= 1) ) {
+ && (tvb_captured_length_remaining(tvb_a, offset_a) >= 1) ) {
/*
* INQUIRY response with device type information; add device type
* to list of known devices & their types if not already known.
@@ -3649,7 +3649,7 @@ dissect_scsi_log_page(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
if (log_parameter && log_parameter->dissector) {
tvbuff_t *param_tvb;
- param_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),paramlen), paramlen);
+ param_tvb = tvb_new_subset(tvb, offset, MIN(tvb_captured_length_remaining(tvb, offset),paramlen), paramlen);
log_parameter->dissector(param_tvb, pinfo, log_tree);
} else {
/* We did not have a dissector for this page/parameter so
@@ -3756,14 +3756,14 @@ dissect_scsi_blockdescs(tvbuff_t *tvb, packet_info *pinfo _U_,
if (!cdata)
return;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
if (longlba) {
- if (tvb_length_remaining(tvb, offset)<8)
+ if (tvb_captured_length_remaining(tvb, offset)<8)
return;
proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks64, tvb, offset, 8, ENC_BIG_ENDIAN);
offset += 8;
- if (tvb_length_remaining(tvb, offset)<1)
+ if (tvb_captured_length_remaining(tvb, offset)<1)
return;
proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_density_code, tvb, offset, 1, ENC_NA);
offset += 1;
@@ -3771,37 +3771,37 @@ dissect_scsi_blockdescs(tvbuff_t *tvb, packet_info *pinfo _U_,
/* 3 reserved bytes */
offset += 3;
- if (tvb_length_remaining(tvb, offset)<4)
+ if (tvb_captured_length_remaining(tvb, offset)<4)
return;
proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length32, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
} else {
if ((cdata->itl->cmdset&SCSI_CMDSET_MASK) == SCSI_DEV_SBC) {
- if (tvb_length_remaining(tvb, offset)<4)
+ if (tvb_captured_length_remaining(tvb, offset)<4)
return;
proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks32, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
offset++; /* reserved */
- if (tvb_length_remaining(tvb, offset)<3)
+ if (tvb_captured_length_remaining(tvb, offset)<3)
return;
proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length24, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
} else {
- if (tvb_length_remaining(tvb, offset)<1)
+ if (tvb_captured_length_remaining(tvb, offset)<1)
return;
proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_density_code, tvb, offset, 1, ENC_NA);
offset += 1;
- if (tvb_length_remaining(tvb, offset)<3)
+ if (tvb_captured_length_remaining(tvb, offset)<3)
return;
proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks24, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
offset++; /* reserved */
- if (tvb_length_remaining(tvb, offset)<3)
+ if (tvb_captured_length_remaining(tvb, offset)<3)
return;
proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length24, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
@@ -4447,8 +4447,8 @@ dissect_spc_modeselect6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
payload_len -= 1;
- if (tvb_length_remaining(tvb, offset)>0) {
- blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),desclen), desclen);
+ if (tvb_captured_length_remaining(tvb, offset)>0) {
+ blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_captured_length_remaining(tvb, offset),desclen), desclen);
dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, FALSE);
}
offset += desclen;
@@ -4541,8 +4541,8 @@ dissect_spc_modeselect10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 2;
payload_len -= 2;
- if (tvb_length_remaining(tvb, offset)>0) {
- blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),desclen), desclen);
+ if (tvb_captured_length_remaining(tvb, offset)>0) {
+ blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_captured_length_remaining(tvb, offset),desclen), desclen);
dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, longlba);
}
offset += desclen;
@@ -4671,8 +4671,8 @@ dissect_spc_modesense6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tot_len -= 1;
- if (tvb_length_remaining(tvb, offset)>0) {
- blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),desclen), desclen);
+ if (tvb_captured_length_remaining(tvb, offset)>0) {
+ blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_captured_length_remaining(tvb, offset),desclen), desclen);
dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, FALSE);
}
offset += desclen;
@@ -4761,8 +4761,8 @@ dissect_spc_modesense10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 2;
tot_len -= 2;
- if (tvb_length_remaining(tvb, offset)>0) {
- blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),desclen), desclen);
+ if (tvb_captured_length_remaining(tvb, offset)>0) {
+ blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_captured_length_remaining(tvb, offset),desclen), desclen);
dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, longlba);
}
offset += desclen;
@@ -5985,7 +5985,7 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return;
}
- payload_len = tvb_length(tvb);
+ payload_len = tvb_captured_length(tvb);
cdata = wmem_new(wmem_packet_scope(), scsi_task_data_t);
cdata->itl = itl;
cdata->itlq = itlq;
@@ -6070,7 +6070,7 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* If we dont have the entire PDU there is no point in even trying
* reassembly
*/
- 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)) {
if (relative_offset) {
call_dissector(data_handle, tvb, pinfo, scsi_tree);
goto end_of_payload;
@@ -6096,17 +6096,17 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* If this PDU already contains all the expected data we dont have to do
* reassembly.
*/
- if ( (!relative_offset) && ((guint32)tvb_length_remaining(tvb, offset) == expected_length) ) {
+ if ( (!relative_offset) && ((guint32)tvb_captured_length_remaining(tvb, offset) == expected_length) ) {
goto dissect_the_payload;
}
/* Start reassembly */
- if (tvb_length_remaining(tvb, offset) < 0) {
+ if (tvb_captured_length_remaining(tvb, offset) < 0) {
goto end_of_payload;
}
- if ((tvb_length_remaining(tvb,offset) + relative_offset) != expected_length) {
+ if ((tvb_captured_length_remaining(tvb,offset) + relative_offset) != expected_length) {
more_frags = TRUE;
}
ipfd_head = fragment_add_check(&scsi_reassembly_table, tvb, offset,
@@ -6114,7 +6114,7 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
itlq->first_exchange_frame, /* key */
NULL,
relative_offset,
- tvb_length_remaining(tvb, offset),
+ tvb_captured_length_remaining(tvb, offset),
more_frags);
next_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled SCSI DATA", ipfd_head, &scsi_frag_items, &update_col_info, tree);
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index ed04b741c2..1f83307322 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -1629,7 +1629,7 @@ dissect_add_ip_address_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, pr
proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN);
address_tvb = tvb_new_subset(parameter_tvb, ADDRESS_PARAMETER_OFFSET,
- MIN(address_length, tvb_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)),
+ MIN(address_length, tvb_captured_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)),
MIN(address_length, tvb_reported_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)));
proto_item_append_text(parameter_item, " (Address: ");
dissect_parameter(address_tvb, pinfo, parameter_tree, parameter_item, FALSE, FALSE);
@@ -1646,7 +1646,7 @@ dissect_del_ip_address_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, pr
proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN);
address_tvb = tvb_new_subset(parameter_tvb, ADDRESS_PARAMETER_OFFSET,
- MIN(address_length, tvb_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)),
+ MIN(address_length, tvb_captured_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)),
MIN(address_length, tvb_reported_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)));
proto_item_append_text(parameter_item, " (Address: ");
dissect_parameter(address_tvb, pinfo, parameter_tree, parameter_item, FALSE, FALSE);
@@ -1664,7 +1664,7 @@ dissect_error_cause_indication_parameter(tvbuff_t *parameter_tvb, packet_info *p
proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN);
causes_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH - CORRELATION_ID_LENGTH;
causes_tvb = tvb_new_subset(parameter_tvb, ERROR_CAUSE_IND_CASUES_OFFSET,
- MIN(causes_length, tvb_length_remaining(parameter_tvb, ERROR_CAUSE_IND_CASUES_OFFSET)),
+ MIN(causes_length, tvb_captured_length_remaining(parameter_tvb, ERROR_CAUSE_IND_CASUES_OFFSET)),
MIN(causes_length, tvb_reported_length_remaining(parameter_tvb, ERROR_CAUSE_IND_CASUES_OFFSET)));
dissect_error_causes(causes_tvb, pinfo, parameter_tree);
}
@@ -1679,7 +1679,7 @@ dissect_set_primary_address_parameter(tvbuff_t *parameter_tvb, packet_info *pinf
proto_tree_add_item(parameter_tree, hf_correlation_id, parameter_tvb, CORRELATION_ID_OFFSET, CORRELATION_ID_LENGTH, ENC_BIG_ENDIAN);
address_tvb = tvb_new_subset(parameter_tvb, ADDRESS_PARAMETER_OFFSET,
- MIN(address_length, tvb_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)),
+ MIN(address_length, tvb_captured_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)),
MIN(address_length, tvb_reported_length_remaining(parameter_tvb, ADDRESS_PARAMETER_OFFSET)));
proto_item_append_text(parameter_item, " (Address: ");
dissect_parameter(address_tvb, pinfo, parameter_tree, parameter_item, FALSE, FALSE);
@@ -1944,7 +1944,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- parameter_tvb = tvb_new_subset(parameters_tvb, offset, MIN(total_length, tvb_length_remaining(parameters_tvb, offset)), total_length);
+ parameter_tvb = tvb_new_subset(parameters_tvb, offset, MIN(total_length, tvb_captured_length_remaining(parameters_tvb, offset)), total_length);
/* get rid of the handled parameter */
offset += total_length;
remaining_length = tvb_reported_length_remaining(parameters_tvb, offset);
@@ -2031,7 +2031,7 @@ dissect_unresolvable_address_cause(tvbuff_t *cause_tvb, packet_info *pinfo, prot
parameter_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH;
parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET,
- MIN(parameter_length, tvb_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
+ MIN(parameter_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
MIN(parameter_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
proto_item_append_text(cause_item, " (Address: ");
dissect_parameter(parameter_tvb, pinfo, cause_tree, cause_item, FALSE, FALSE);
@@ -2050,7 +2050,7 @@ dissect_unrecognized_chunk_type_cause(tvbuff_t *cause_tvb, packet_info *pinfo,
chunk_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH;
unrecognized_chunk_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET,
- MIN(chunk_length, tvb_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
+ MIN(chunk_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
MIN(chunk_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
dissect_sctp_chunk(unrecognized_chunk_tvb, pinfo, cause_tree,cause_tree, NULL, FALSE);
unrecognized_type = tvb_get_guint8(unrecognized_chunk_tvb, CHUNK_TYPE_OFFSET);
@@ -2071,7 +2071,7 @@ dissect_unrecognized_parameters_cause(tvbuff_t *cause_tvb, packet_info *pinfo, p
cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH;
unrecognized_parameters_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET,
- MIN(cause_info_length, tvb_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
+ MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
dissect_parameters(unrecognized_parameters_tvb, pinfo, cause_tree, NULL, FALSE);
}
@@ -2099,7 +2099,7 @@ dissect_restart_with_new_address_cause(tvbuff_t *cause_tvb, packet_info *pinfo,
cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH;
parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET,
- MIN(cause_info_length, tvb_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
+ MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
proto_item_append_text(cause_item, " (New addresses: ");
dissect_parameters(parameter_tvb, pinfo, cause_tree, cause_item, FALSE);
@@ -2134,7 +2134,7 @@ dissect_delete_last_address_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto
cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH;
parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET,
- MIN(cause_info_length, tvb_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
+ MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
proto_item_append_text(cause_item, " (Last address: ");
dissect_parameter(parameter_tvb, pinfo, cause_tree, cause_item, FALSE, FALSE);
@@ -2149,7 +2149,7 @@ dissect_resource_outage_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tre
cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH;
parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET,
- MIN(cause_info_length, tvb_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
+ MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
dissect_parameter(parameter_tvb, pinfo, cause_tree, NULL, FALSE, FALSE);
}
@@ -2162,7 +2162,7 @@ dissect_delete_source_address_cause(tvbuff_t *cause_tvb, packet_info *pinfo, pro
cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH;
parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET,
- MIN(cause_info_length, tvb_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
+ MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
proto_item_append_text(cause_item, " (Deleted address: ");
dissect_parameter(parameter_tvb, pinfo, cause_tree, cause_item, FALSE, FALSE);
@@ -2177,7 +2177,7 @@ dissect_request_refused_cause(tvbuff_t *cause_tvb, packet_info *pinfo, proto_tre
cause_info_length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET) - CAUSE_HEADER_LENGTH;
parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET,
- MIN(cause_info_length, tvb_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
+ MIN(cause_info_length, tvb_captured_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)),
MIN(cause_info_length, tvb_reported_length_remaining(cause_tvb, CAUSE_INFO_OFFSET)));
dissect_parameter(parameter_tvb, pinfo, cause_tree, NULL, FALSE, FALSE);
}
@@ -2341,7 +2341,7 @@ dissect_error_causes(tvbuff_t *causes_tvb, packet_info *pinfo, proto_tree *tree)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */
- cause_tvb = tvb_new_subset(causes_tvb, offset, MIN(total_length, tvb_length_remaining(causes_tvb, offset)), total_length);
+ cause_tvb = tvb_new_subset(causes_tvb, offset, MIN(total_length, tvb_captured_length_remaining(causes_tvb, offset)), total_length);
dissect_error_cause(cause_tvb, pinfo, tree);
@@ -2642,14 +2642,14 @@ add_fragment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tsn,
}
/* There is no point in storing a fragment with no data in it */
- if (tvb_length(tvb) == 0)
+ if (tvb_captured_length(tvb) == 0)
return NULL;
/* create new fragment */
fragment = (sctp_fragment *)g_malloc (sizeof (sctp_fragment));
fragment->frame_num = pinfo->fd->num;
fragment->tsn = tsn;
- fragment->len = tvb_length(tvb);
+ fragment->len = tvb_captured_length(tvb);
fragment->next = NULL;
fragment->data = (unsigned char *)g_malloc (fragment->len);
tvb_memcpy(tvb, fragment->data, 0, fragment->len);
@@ -3078,7 +3078,7 @@ dissect_fragmented_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree
* If this is a short frame, then we can't, and don't, do
* reassembly on it. We just give up.
*/
- if (tvb_reported_length(payload_tvb) > tvb_length(payload_tvb))
+ if (tvb_reported_length(payload_tvb) > tvb_captured_length(payload_tvb))
return TRUE;
/* add fragement to list of known fragments. returns NULL if segment is a duplicate */
@@ -3211,7 +3211,7 @@ dissect_data_chunk(tvbuff_t *chunk_tvb,
is_retransmission = sctp_tsn(pinfo, chunk_tvb, tsn_item, ha, tsn);
payload_tvb = tvb_new_subset(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET,
- MIN(chunk_length - DATA_CHUNK_HEADER_LENGTH, tvb_length_remaining(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET)),
+ MIN(chunk_length - DATA_CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET)),
MIN(chunk_length - DATA_CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET)));
/* Is this a fragment? */
@@ -3352,7 +3352,7 @@ dissect_init_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinfo
/* handle variable parameters */
chunk_length -= INIT_CHUNK_FIXED_PARAMTERS_LENGTH;
parameters_tvb = tvb_new_subset(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET,
- MIN(chunk_length, tvb_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET)),
+ MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET)),
MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET)));
dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, TRUE);
}
@@ -3386,7 +3386,7 @@ dissect_init_ack_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *p
/* handle variable paramters */
chunk_length -= INIT_CHUNK_FIXED_PARAMTERS_LENGTH;
parameters_tvb = tvb_new_subset(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET,
- MIN(chunk_length, tvb_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET)),
+ MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET)),
MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET)));
dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, TRUE);
}
@@ -3721,7 +3721,7 @@ dissect_heartbeat_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *
if (chunk_tree) {
proto_item_append_text(chunk_item, " (Information: %u byte%s)", chunk_length - CHUNK_HEADER_LENGTH, plurality(chunk_length - CHUNK_HEADER_LENGTH, "", "s"));
parameter_tvb = tvb_new_subset(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET,
- MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_length_remaining(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET)),
+ MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET)),
MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET)));
/* FIXME: Parameters or parameter? */
dissect_parameter(parameter_tvb, pinfo, chunk_tree, NULL, FALSE, TRUE);
@@ -3736,7 +3736,7 @@ dissect_heartbeat_ack_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_in
if (chunk_tree) {
proto_item_append_text(chunk_item, " (Information: %u byte%s)", chunk_length - CHUNK_HEADER_LENGTH, plurality(chunk_length - CHUNK_HEADER_LENGTH, "", "s"));
parameter_tvb = tvb_new_subset(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET,
- MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_length_remaining(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET)),
+ MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET)),
MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, HEARTBEAT_CHUNK_INFO_OFFSET)));
/* FIXME: Parameters or parameter? */
dissect_parameter(parameter_tvb, pinfo, chunk_tree, NULL, FALSE, TRUE);
@@ -3759,7 +3759,7 @@ dissect_abort_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinf
flags_tree = proto_item_add_subtree(flags_item, ett_sctp_abort_chunk_flags);
proto_tree_add_item(flags_tree, hf_abort_chunk_t_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN);
causes_tvb = tvb_new_subset(chunk_tvb, CHUNK_VALUE_OFFSET,
- MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_length_remaining(chunk_tvb, CHUNK_VALUE_OFFSET)),
+ MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, CHUNK_VALUE_OFFSET)),
MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, CHUNK_VALUE_OFFSET)));
dissect_error_causes(causes_tvb, pinfo, chunk_tree);
}
@@ -3791,7 +3791,7 @@ dissect_error_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pinf
if (chunk_tree) {
causes_tvb = tvb_new_subset(chunk_tvb, ERROR_CAUSE_IND_CAUSES_OFFSET,
- MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_length_remaining(chunk_tvb, ERROR_CAUSE_IND_CAUSES_OFFSET)),
+ MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, ERROR_CAUSE_IND_CAUSES_OFFSET)),
MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, ERROR_CAUSE_IND_CAUSES_OFFSET)));
dissect_error_causes(causes_tvb, pinfo, chunk_tree);
}
@@ -3901,7 +3901,7 @@ dissect_re_config_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *
tvbuff_t *parameters_tvb;
parameters_tvb = tvb_new_subset(chunk_tvb, RE_CONFIG_PARAMETERS_OFFSET,
- MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_length_remaining(chunk_tvb, RE_CONFIG_PARAMETERS_OFFSET)),
+ MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, RE_CONFIG_PARAMETERS_OFFSET)),
MIN(chunk_length - CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, RE_CONFIG_PARAMETERS_OFFSET)));
dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, FALSE);
}
@@ -3944,7 +3944,7 @@ dissect_asconf_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pin
}
chunk_length -= CHUNK_HEADER_LENGTH + SCTP_SEQUENCE_NUMBER_LENGTH;
parameters_tvb = tvb_new_subset(chunk_tvb, ASCONF_CHUNK_PARAMETERS_OFFSET,
- MIN(chunk_length, tvb_length_remaining(chunk_tvb, ASCONF_CHUNK_PARAMETERS_OFFSET)),
+ MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, ASCONF_CHUNK_PARAMETERS_OFFSET)),
MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, ASCONF_CHUNK_PARAMETERS_OFFSET)));
dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, FALSE);
}
@@ -3967,7 +3967,7 @@ dissect_asconf_ack_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info
}
chunk_length -= CHUNK_HEADER_LENGTH + SCTP_SEQUENCE_NUMBER_LENGTH;
parameters_tvb = tvb_new_subset(chunk_tvb, ASCONF_ACK_CHUNK_PARAMETERS_OFFSET,
- MIN(chunk_length, tvb_length_remaining(chunk_tvb, ASCONF_ACK_CHUNK_PARAMETERS_OFFSET)),
+ MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, ASCONF_ACK_CHUNK_PARAMETERS_OFFSET)),
MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, ASCONF_ACK_CHUNK_PARAMETERS_OFFSET)));
dissect_parameters(parameters_tvb, pinfo, chunk_tree, NULL, FALSE);
}
@@ -4022,7 +4022,7 @@ dissect_pktdrop_chunk(tvbuff_t *chunk_tvb, guint16 chunk_length, packet_info *pi
}
chunk_length -= PKTDROP_CHUNK_HEADER_LENGTH;
data_field_tvb = tvb_new_subset(chunk_tvb, PKTDROP_CHUNK_DATA_FIELD_OFFSET,
- MIN(chunk_length, tvb_length_remaining(chunk_tvb, PKTDROP_CHUNK_DATA_FIELD_OFFSET)),
+ MIN(chunk_length, tvb_captured_length_remaining(chunk_tvb, PKTDROP_CHUNK_DATA_FIELD_OFFSET)),
MIN(chunk_length, tvb_reported_length_remaining(chunk_tvb, PKTDROP_CHUNK_DATA_FIELD_OFFSET)));
if (chunk_tree) {
@@ -4252,7 +4252,7 @@ dissect_sctp_chunks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_i
total_length = MIN(total_length, remaining_length);
/* create a tvb for the chunk including the padding bytes */
- chunk_tvb = tvb_new_subset(tvb, offset, MIN(total_length, tvb_length_remaining(tvb, offset)), total_length);
+ chunk_tvb = tvb_new_subset(tvb, offset, MIN(total_length, tvb_captured_length_remaining(tvb, offset)), total_length);
/* save it in the sctp_info structure */
if (!encapsulated) {
@@ -4327,7 +4327,7 @@ dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
sctp_half_assoc_t *ha = NULL;
proto_item *pi, *vt = NULL;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
checksum = tvb_get_ntohl(tvb, CHECKSUM_OFFSET);
sctp_info.checksum_zero = (checksum == 0);
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index a62eb19166..9bf4b40cba 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -553,7 +553,7 @@ dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti,
tokenlen = -1; /* end of tvbuff */
/* Save connection address */
media_info->connection_address =
- (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset), ENC_UTF_8|ENC_NA);
+ (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_UTF_8|ENC_NA);
} else {
tokenlen = next_offset - offset;
/* Save connection address */
@@ -766,7 +766,7 @@ static void dissect_key_mgmt(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti
offset = next_offset + 1;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if (len < 0)
return;
@@ -1196,7 +1196,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
proto_tree_add_text(tree, tvb, offset, tokenlen, "Could not convert '%s' to 3 bytes", format_specific_parameter);
return;
}
- length = tvb_length(data_tvb);
+ length = tvb_captured_length(data_tvb);
if (length == 3) {
if (h264_handle && data_tvb) {
dissect_h264_profile(data_tvb, pinfo, tree);
@@ -1339,10 +1339,10 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
/* Skip colon */
offset = colon_offset + 1;
/* skip leading wsp */
- offset = tvb_skip_wsp(tvb, offset, tvb_length_remaining(tvb, offset));
+ offset = tvb_skip_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset));
/* Value is the remainder of the line */
- attribute_value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset), ENC_UTF_8|ENC_NA);
+ attribute_value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_UTF_8|ENC_NA);
@@ -1431,7 +1431,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
guint8 media_format;
/* Reading the Format parameter(fmtp) */
/* Skip leading space, if any */
- offset = tvb_skip_wsp(tvb, offset, tvb_length_remaining(tvb, offset));
+ offset = tvb_skip_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset));
/* Media format extends to the next space */
next_offset = tvb_find_guint8(tvb, offset, -1, ' ');
@@ -1461,11 +1461,11 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
while (has_more_pars == TRUE) {
next_offset = tvb_find_guint8(tvb, offset, -1, ';');
- offset = tvb_skip_wsp(tvb, offset, tvb_length_remaining(tvb, offset));
+ offset = tvb_skip_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset));
if (next_offset == -1) {
has_more_pars = FALSE;
- next_offset= tvb_length(tvb);
+ next_offset= tvb_captured_length(tvb);
}
/* There are at least 2 - add the first parameter */
@@ -1637,7 +1637,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
param_end_offset = tvb_find_guint8(tvb, offset, -1, ';');
if (param_end_offset == -1) {
has_more_pars = FALSE;
- param_end_offset = tvb_length(tvb);
+ param_end_offset = tvb_captured_length(tvb);
}
/* key-method or key-method-ext */
next_offset = tvb_find_guint8(tvb, offset, -1, ':');
@@ -2608,7 +2608,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- datalen = tvb_length_remaining(tvb, offset);
+ datalen = tvb_captured_length_remaining(tvb, offset);
if (datalen > 0) {
proto_tree_add_text(sdp_tree, tvb, offset, datalen, "Data (%d bytes)", datalen);
}
diff --git a/epan/dissectors/packet-sebek.c b/epan/dissectors/packet-sebek.c
index ec22f89e4b..0da41867f8 100644
--- a/epan/dissectors/packet-sebek.c
+++ b/epan/dissectors/packet-sebek.c
@@ -132,7 +132,7 @@ dissect_sebek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
col_set_str(pinfo->cinfo, COL_INFO, "SEBEK - ");
- if (tvb_length(tvb)<6)
+ if (tvb_captured_length(tvb)<6)
sebek_ver = 0;
else
sebek_ver = tvb_get_ntohs(tvb, 4);
@@ -161,7 +161,7 @@ dissect_sebek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
sebek_tree = proto_item_add_subtree(ti, ett_sebek);
/* check for minimum length before deciding where to go*/
- if (tvb_length(tvb)<6)
+ if (tvb_captured_length(tvb)<6)
sebek_ver = 0;
else
sebek_ver = tvb_get_ntohs(tvb, 4);
diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c
index 5512034b9e..2fdfb9513c 100644
--- a/epan/dissectors/packet-selfm.c
+++ b/epan/dissectors/packet-selfm.c
@@ -1023,7 +1023,7 @@ dissect_relaydef_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(relaydef_tree, hf_selfm_checksum, tvb, offset, 1, ENC_BIG_ENDIAN);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1131,7 +1131,7 @@ dissect_fmconfig_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(fmconfig_tree, hf_selfm_checksum, tvb, offset, 1, ENC_BIG_ENDIAN);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1364,7 +1364,7 @@ dissect_fmdata_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int of
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1449,7 +1449,7 @@ dissect_foconfig_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(foconfig_tree, hf_selfm_checksum, tvb, offset, 1, ENC_BIG_ENDIAN);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1490,7 +1490,7 @@ dissect_alt_fastop_config_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+7, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+8, 1, ENC_BIG_ENDIAN);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1541,7 +1541,7 @@ dissect_fastop_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int of
/* Add checksum */
proto_tree_add_item(fastop_tree, hf_selfm_checksum, tvb, offset, 1, ENC_BIG_ENDIAN);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -1579,7 +1579,7 @@ dissect_alt_fastop_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, in
/* Operate Code Validation */
proto_tree_add_item(fastop_tree, hf_selfm_alt_fastop_valid, tvb, offset, 2, ENC_BIG_ENDIAN);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -2288,7 +2288,7 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -2312,7 +2312,7 @@ dissect_selfm(tvbuff_t *selfm_tvb, packet_info *pinfo, proto_tree *tree, void* d
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SEL Fast Msg");
col_clear(pinfo->cinfo, COL_INFO);
- len = tvb_length(selfm_tvb);
+ len = tvb_captured_length(selfm_tvb);
msg_type = tvb_get_ntohs(selfm_tvb, offset);
@@ -2491,7 +2491,7 @@ dissect_selfm(tvbuff_t *selfm_tvb, packet_info *pinfo, proto_tree *tree, void* d
} /* remaining length > 0 */
} /* tree */
- return tvb_length(selfm_tvb);
+ return tvb_captured_length(selfm_tvb);
}
/******************************************************************************************************/
@@ -2505,11 +2505,11 @@ get_selfm_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_)
guint message_len=0; /* message length, inclusive of header, data, crc */
/* Get length byte from message */
- if (tvb_length(tvb) > 2) {
+ if (tvb_captured_length(tvb) > 2) {
message_len = tvb_get_guint8(tvb, 2);
}
/* for 2-byte poll messages, set the length to 2 */
- else if (tvb_length(tvb) == 2) {
+ else if (tvb_captured_length(tvb) == 2) {
message_len = 2;
}
@@ -2524,7 +2524,7 @@ dissect_selfm_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
{
tvbuff_t *selfm_tvb;
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
/* Check for a SEL FM packet. It should begin with 0xA5 */
if(length < 2 || tvb_get_guint8(tvb, 0) != 0xA5) {
@@ -2554,7 +2554,7 @@ dissect_selfm_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
static int
dissect_selfm_simple(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 SEL FM packet. It should begin with 0xA5 */
if(length < 2 || tvb_get_guint8(tvb, 0) != 0xA5) {
diff --git a/epan/dissectors/packet-ses.c b/epan/dissectors/packet-ses.c
index 2a0814dbe0..232d41dc8b 100644
--- a/epan/dissectors/packet-ses.c
+++ b/epan/dissectors/packet-ses.c
@@ -1158,7 +1158,7 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
* No more SPDUs to dissect. Set the offset to the
* end of the tvbuff.
*/
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
if (session.rtse_reassemble && type == SES_DATA_TRANSFER) {
ses_pres_ctx_id = session.pres_ctx_id;
ses_rtse_reassemble = TRUE;
@@ -1938,7 +1938,7 @@ dissect_ses_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
guint16 len;
/* first, check do we have at least 4 bytes (type+length) */
- if (tvb_length(tvb) < 2)
+ if (tvb_captured_length(tvb) < 2)
return FALSE; /* no */
/* can we recognize session PDU ? Return FALSE if not */
@@ -1966,7 +1966,7 @@ dissect_ses_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
* misinterpreted as SES.
* the starter in this case is fixed to 0x32 (SES_MINOR_SYNC_ACK for SES),
* so if the parameter type is unknown, it's probably SIMATIC */
- if(type == 0x32 && tvb_length(tvb) >= 3) {
+ if(type == 0x32 && tvb_captured_length(tvb) >= 3) {
type = tvb_get_guint8(tvb, offset+2);
if (try_val_to_str(type, param_vals) == NULL) {
return FALSE; /* it's probably a SIMATIC protocol */
@@ -1980,11 +1980,11 @@ dissect_ses_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
/* add header length */
len+=len_len;
/* do we have enough bytes ? */
- if (tvb_length(tvb) < len)
+ if (tvb_captured_length(tvb) < len)
return FALSE; /* no */
/* final check to see if the next SPDU, if present, is also valid */
- if (tvb_length(tvb) > 1+(guint) len) {
+ if (tvb_captured_length(tvb) > 1+(guint) len) {
type = tvb_get_guint8(tvb, offset + len + 1);
/* check SPDU type */
if (try_val_to_str(type, ses_vals) == NULL) {
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c
index 53686c0a96..39c7d9f73b 100644
--- a/epan/dissectors/packet-sflow.c
+++ b/epan/dissectors/packet-sflow.c
@@ -2438,7 +2438,7 @@ dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
offset = dissect_sflow_245_samples(tvb, pinfo, sflow_245_tree, offset, version);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-sgsap.c b/epan/dissectors/packet-sgsap.c
index 84a706b40c..4c87635abf 100644
--- a/epan/dissectors/packet-sgsap.c
+++ b/epan/dissectors/packet-sgsap.c
@@ -1395,7 +1395,7 @@ dissect_sgsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 oct;
/* Save pinfo */
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/* Make entry in the Protocol column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c
index c6f6156b22..4c93ed7acd 100644
--- a/epan/dissectors/packet-sigcomp.c
+++ b/epan/dissectors/packet-sigcomp.c
@@ -421,7 +421,7 @@ dissect_sigcomp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *_
col_clear(pinfo->cinfo, COL_INFO);
- length = tvb_length_remaining(tvb,offset);
+ length = tvb_captured_length_remaining(tvb,offset);
try_again:
/* create display subtree for the protocol */
@@ -454,7 +454,7 @@ try_again:
if (udvm_print_detail_level>2)
proto_tree_add_text(sigcomp_tree, tvb, offset, 2,
" Illegal escape code");
- offset = offset + tvb_length_remaining(tvb,offset);
+ offset = offset + tvb_captured_length_remaining(tvb,offset);
return offset;
}
if ( octet == 0xff){
@@ -753,7 +753,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
ti = proto_tree_add_text(sigcomp_tree, tvb, 0, -1,"Failed to Access state Wireshark UDVM diagnostic: %s.",
val_to_str(result_code, result_code_vals,"Unknown (%u)"));
PROTO_ITEM_SET_GENERATED(ti);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
udvm_tvb = tvb_new_child_real_data(tvb, buff,state_length+state_address,state_length+state_address);
@@ -774,7 +774,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
if ( decomp_tvb ){
proto_item *ti;
guint32 compression_ratio =
- (guint32)(((float)tvb_length(decomp_tvb) / (float)tvb_length(tvb)) * 100);
+ (guint32)(((float)tvb_captured_length(decomp_tvb) / (float)tvb_captured_length(tvb)) * 100);
/* Celebrate success and show compression ratio achieved */
proto_tree_add_text(sigcomp_tree, decomp_tvb, 0, -1,"SigComp message Decompressed WOHO!!");
@@ -908,7 +908,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
if ( decomp_tvb ){
proto_item *ti;
guint32 compression_ratio =
- (guint32)(((float)tvb_length(decomp_tvb) / (float)tvb_length(tvb)) * 100);
+ (guint32)(((float)tvb_captured_length(decomp_tvb) / (float)tvb_captured_length(tvb)) * 100);
/* Celebrate success and show compression ratio achieved */
proto_tree_add_text(sigcomp_tree, decomp_tvb, 0, -1,"SigComp message Decompressed WOHO!!");
@@ -927,7 +927,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
}/*if len==0 */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-simulcrypt.c b/epan/dissectors/packet-simulcrypt.c
index 71dc217123..eabf00b44a 100644
--- a/epan/dissectors/packet-simulcrypt.c
+++ b/epan/dissectors/packet-simulcrypt.c
@@ -687,7 +687,7 @@ dissect_simulcrypt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, FRAME_HEADER_LEN,
get_simulcrypt_message_len, dissect_simulcrypt_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Informative tree structure is shown here:
@@ -1270,7 +1270,7 @@ dissect_simulcrypt_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} /* end tree */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* this method is used to dissect TLV parameters */
diff --git a/epan/dissectors/packet-skinny.c b/epan/dissectors/packet-skinny.c
index 00b20718fc..939b5562b5 100644
--- a/epan/dissectors/packet-skinny.c
+++ b/epan/dissectors/packet-skinny.c
@@ -3458,7 +3458,7 @@ dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
}
}
tap_queue_packet(skinny_tap, pinfo, si);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -3475,7 +3475,7 @@ dissect_skinny(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* check, if this is really an SKINNY packet, they start with a length + 0 */
- if (tvb_length_remaining(tvb, 0) < 8)
+ if (tvb_captured_length_remaining(tvb, 0) < 8)
{
return FALSE;
}
@@ -3483,7 +3483,7 @@ dissect_skinny(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
hdr_data_length = tvb_get_letohl(tvb, 0);
hdr_version = 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) ||
diff --git a/epan/dissectors/packet-skype.c b/epan/dissectors/packet-skype.c
index 30c7e926e6..38690bf9d5 100644
--- a/epan/dissectors/packet-skype.c
+++ b/epan/dissectors/packet-skype.c
@@ -134,7 +134,7 @@ dissect_skype_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* XXX: Just until we know how to decode skype over tcp */
packet_type = 255;
- packet_length = tvb_length(tvb);
+ packet_length = tvb_captured_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type,
@@ -189,7 +189,7 @@ dissect_skype_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
packet_type = tvb_get_guint8(tvb, 2) & SKYPE_SOM_TYPE_MASK;
packet_unk = (tvb_get_guint8(tvb, 2) & SKYPE_SOM_UNK_MASK) >> 4;
- packet_length = tvb_length(tvb);
+ packet_length = tvb_captured_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type,
@@ -294,7 +294,7 @@ static gboolean
test_skype_udp(tvbuff_t *tvb)
{
/* Minimum of 3 bytes, check for valid message type */
- guint length = tvb_length(tvb);
+ guint length = tvb_captured_length(tvb);
guint8 type = tvb_get_guint8(tvb, 2) & 0xF;
if ( length >= 3 &&
( type == 0 ||
diff --git a/epan/dissectors/packet-slsk.c b/epan/dissectors/packet-slsk.c
index 0f37fb1fec..e410e62895 100644
--- a/epan/dissectors/packet-slsk.c
+++ b/epan/dissectors/packet-slsk.c
@@ -243,16 +243,16 @@ static gboolean check_slsk_format(tvbuff_t *tvb, int offset, const char format[]
switch ( format[0] ) {
case 'i':
- if (tvb_length_remaining(tvb, offset) < 4) return FALSE;
+ if (tvb_captured_length_remaining(tvb, offset) < 4) return FALSE;
offset += 4;
break;
case 'b':
- if (tvb_length_remaining(tvb, offset) < 1) return FALSE;
+ if (tvb_captured_length_remaining(tvb, offset) < 1) return FALSE;
offset += 1;
break;
case 's':
- if (tvb_length_remaining(tvb, offset) < 4) return FALSE;
- if (tvb_length_remaining(tvb, offset) < (int)tvb_get_letohl(tvb, offset)+4) return FALSE;
+ if (tvb_captured_length_remaining(tvb, offset) < 4) return FALSE;
+ if (tvb_captured_length_remaining(tvb, offset) < (int)tvb_get_letohl(tvb, offset)+4) return FALSE;
offset += tvb_get_letohl(tvb, offset)+4;
break;
case '*':
@@ -262,7 +262,7 @@ static gboolean check_slsk_format(tvbuff_t *tvb, int offset, const char format[]
}
if (format[1] == '\0' ) {
- if (tvb_length_remaining(tvb, offset) > 0) /* Checks for additional bytes at the end */
+ if (tvb_captured_length_remaining(tvb, offset) > 0) /* Checks for additional bytes at the end */
return FALSE;
return TRUE;
}
@@ -467,7 +467,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 4;
/* [zlib compressed] */
- comprlen = tvb_length_remaining(tvb, offset);
+ comprlen = tvb_captured_length_remaining(tvb, offset);
if (slsk_decompress == TRUE){
@@ -476,7 +476,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (uncompr_tvb == NULL) {
proto_tree_add_text(slsk_tree, tvb, offset, -1,
"[zlib compressed packet]");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
proto_tree_add_text(slsk_tree, tvb, 0, 0,
"(uncompression failed !)");
} else {
@@ -588,7 +588,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"[zlib compressed packet]");
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, 0, 0,
"( compressed packet length: %d)", comprlen);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
}
break;
@@ -628,16 +628,16 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 4;
/* [zlib compressed] */
- comprlen = tvb_length_remaining(tvb, offset);
+ comprlen = tvb_captured_length_remaining(tvb, offset);
if (slsk_decompress == TRUE){
tvbuff_t *uncompr_tvb = tvb_child_uncompress(tvb, tvb, offset, comprlen);
if (uncompr_tvb == NULL) {
- proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, tvb_length_remaining(tvb, offset), 0,
+ proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, tvb_captured_length_remaining(tvb, offset), 0,
"[zlib compressed packet]");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, 0, 0, 0,
"(uncompression failed !)");
} else {
@@ -647,7 +647,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"( compressed packet length: %d)", comprlen);
- uncomprlen = tvb_length_remaining(uncompr_tvb, 0);
+ uncomprlen = tvb_captured_length_remaining(uncompr_tvb, 0);
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"(uncompressed packet length: %d)", uncomprlen);
@@ -733,7 +733,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"[zlib compressed packet]");
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"( compressed packet length: %d)", comprlen);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
}
break;
@@ -1171,7 +1171,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 4;
/* [zlib compressed] */
- comprlen = tvb_length_remaining(tvb, offset);
+ comprlen = tvb_captured_length_remaining(tvb, offset);
if (slsk_decompress == TRUE){
@@ -1180,7 +1180,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (uncompr_tvb == NULL) {
proto_tree_add_text(slsk_tree, tvb, offset, -1,
"[zlib compressed packet]");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
proto_tree_add_text(slsk_tree, tvb, 0, 0,
"[uncompression failed !]");
} else {
@@ -1190,7 +1190,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"[compressed packet length: %d]", comprlen);
- uncomprlen = tvb_length_remaining(uncompr_tvb, 0);
+ uncomprlen = tvb_captured_length_remaining(uncompr_tvb, 0);
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"[uncompressed packet length: %d]", uncomprlen);
@@ -1299,7 +1299,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"[zlib compressed packet]");
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"( compressed packet length: %d)", comprlen);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
}
break;
@@ -1356,7 +1356,7 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"Download allowed: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
offset += 1;
if ( i == 1 ) {
- if ( tvb_length_remaining(tvb, offset) == 8 ) {
+ if ( tvb_captured_length_remaining(tvb, offset) == 8 ) {
proto_tree_add_uint(slsk_tree, hf_slsk_size, tvb, offset, 4, tvb_get_letohl(tvb, offset));
offset += 4;
proto_tree_add_uint(slsk_tree, hf_slsk_integer, tvb, offset, 4, tvb_get_letohl(tvb, offset));
@@ -2382,14 +2382,14 @@ static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
expert_add_info(pinfo, ti_len, &ei_slsk_unknown_data);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_slsk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, slsk_desegment, 4, get_slsk_pdu_len, dissect_slsk_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-smb-logon.c b/epan/dissectors/packet-smb-logon.c
index 37800312c3..2c5c2750a6 100644
--- a/epan/dissectors/packet-smb-logon.c
+++ b/epan/dissectors/packet-smb-logon.c
@@ -820,7 +820,7 @@ dissect_smb_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int
proto_tree_add_text(tree, tvb, offset, -1, "Data (%u bytes)",
tvb_reported_length_remaining(tvb, offset));
- return offset+tvb_length_remaining(tvb, offset);
+ return offset+tvb_captured_length_remaining(tvb, offset);
}
#define LOGON_LM10_LOGON_REQUEST 0x00
diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c
index aabb34fc45..325924cec4 100644
--- a/epan/dissectors/packet-smb-pipe.c
+++ b/epan/dissectors/packet-smb-pipe.c
@@ -2525,7 +2525,7 @@ dissect_response_data(tvbuff_t *tvb, packet_info *pinfo, int convert,
proto_tree_add_text(data_tree, tvb, offset, -1,
"Data (no descriptor available)");
}
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
} else {
/*
* If we have an entry count, show all the entries,
@@ -3254,7 +3254,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
pinfo->desegment_offset = 0;
pinfo->desegment_len = 0;
reported_len = tvb_reported_length(d_tvb);
- if(smb_dcerpc_reassembly && tvb_length(d_tvb) >= reported_len){
+ if(smb_dcerpc_reassembly && tvb_captured_length(d_tvb) >= reported_len){
pinfo->can_desegment=2;
}
@@ -3498,7 +3498,7 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
* anything.)
*/
if (sp_tvb != NULL)
- sp_len = tvb_length(sp_tvb);
+ sp_len = tvb_captured_length(sp_tvb);
else
sp_len = 0;
if (tree) {
@@ -3511,7 +3511,7 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
/*
* Do we have any setup words at all?
*/
- if (s_tvb != NULL && tvb_length(s_tvb) != 0) {
+ if (s_tvb != NULL && tvb_captured_length(s_tvb) != 0) {
/*
* Yes. The first of them is the function.
*/
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 18169cfa22..c433203a7b 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -920,7 +920,7 @@ static int dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, pr
#define END_OF_SMB \
if (bc != 0) { \
gint bc_remaining; \
- bc_remaining = tvb_length_remaining(tvb, offset); \
+ bc_remaining = tvb_captured_length_remaining(tvb, offset); \
if ( ((gint)bc) > bc_remaining) { \
bc = bc_remaining; \
} \
@@ -2617,8 +2617,8 @@ dissect_negprot_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
* of the security blob.
*/
sbloblen = bc;
- if (sbloblen > tvb_length_remaining(tvb, offset)) {
- sbloblen = tvb_length_remaining(tvb, offset);
+ if (sbloblen > tvb_captured_length_remaining(tvb, offset)) {
+ sbloblen = tvb_captured_length_remaining(tvb, offset);
}
blob_item = proto_tree_add_item(
tree, hf_smb_security_blob,
@@ -4348,7 +4348,7 @@ dissect_file_data(tvbuff_t *tvb, proto_tree *tree, int offset, guint16 bc, guint
offset += bc-datalen;
bc = datalen;
}
- tvblen = tvb_length_remaining(tvb, offset);
+ tvblen = tvb_captured_length_remaining(tvb, offset);
if (bc > tvblen) {
proto_tree_add_bytes_format_value(tree, hf_smb_file_data, tvb, offset, tvblen, NULL, "Incomplete. Only %d of %u bytes", tvblen, bc);
offset += tvblen;
@@ -4374,7 +4374,7 @@ dissect_file_data_dcerpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += bc-datalen;
bc = datalen;
}
- tvblen = tvb_length_remaining(tvb, offset);
+ tvblen = tvb_captured_length_remaining(tvb, offset);
dcerpc_tvb = tvb_new_subset(tvb, offset, tvblen, bc);
dissect_pipe_dcerpc(dcerpc_tvb, pinfo, top_tree, tree, fid);
if (bc > tvblen)
@@ -4474,7 +4474,7 @@ dissect_read_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* feed the export object tap listener */
- tvblen = tvb_length_remaining(tvb, dataoffset);
+ tvblen = tvb_captured_length_remaining(tvb, dataoffset);
if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) {
feed_eo_smb(SMB_COM_READ, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si);
}
@@ -4602,7 +4602,7 @@ dissect_write_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* feed the export object tap listener */
- tvblen = tvb_length_remaining(tvb, dataoffset);
+ tvblen = tvb_captured_length_remaining(tvb, dataoffset);
if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) {
feed_eo_smb(SMB_COM_WRITE, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si);
}
@@ -6736,7 +6736,7 @@ dissect_read_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* feed the export object tap listener */
- tvblen = tvb_length_remaining(tvb, dataoffset);
+ tvblen = tvb_captured_length_remaining(tvb, dataoffset);
if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) {
feed_eo_smb(SMB_COM_READ_ANDX, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si);
}
@@ -6912,7 +6912,7 @@ dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* feed the export object tap listener */
- tvblen = tvb_length_remaining(tvb, dataoffset);
+ tvblen = tvb_captured_length_remaining(tvb, dataoffset);
if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) {
feed_eo_smb(SMB_COM_WRITE_ANDX, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si);
}
@@ -7179,8 +7179,8 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
* of the security blob.
*/
sbloblen_short = sbloblen;
- if (sbloblen_short > tvb_length_remaining(tvb, offset)) {
- sbloblen_short = tvb_length_remaining(tvb, offset);
+ if (sbloblen_short > tvb_captured_length_remaining(tvb, offset)) {
+ sbloblen_short = tvb_captured_length_remaining(tvb, offset);
}
blob_item = proto_tree_add_item(tree, hf_smb_security_blob,
tvb, offset, sbloblen_short,
@@ -7474,8 +7474,8 @@ dissect_session_setup_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tre
* short frames and then we will not see anything at all
* of the security blob.
*/
- if (sbloblen > tvb_length_remaining(tvb, offset)) {
- sbloblen = tvb_length_remaining(tvb, offset);
+ if (sbloblen > tvb_captured_length_remaining(tvb, offset)) {
+ sbloblen = tvb_captured_length_remaining(tvb, offset);
}
blob_item = proto_tree_add_item(tree, hf_smb_security_blob,
tvb, offset, sbloblen, ENC_NA);
@@ -8582,7 +8582,7 @@ dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pro
if (parent_tree) {
guint32 bytes = 0;
- bytes = tvb_length_remaining(tvb, offset);
+ bytes = tvb_captured_length_remaining(tvb, offset);
/*tvb_ensure_bytes_exist(tvb, offset, bc);*/
item = proto_tree_add_text(parent_tree, tvb, offset, bytes,
"%s Data",
@@ -8608,7 +8608,7 @@ dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pro
break;
case NT_TRANS_IOCTL:
/* ioctl data */
- ioctl_tvb = tvb_new_subset(tvb, offset, MIN((int)bc, tvb_length_remaining(tvb, offset)), bc);
+ ioctl_tvb = tvb_new_subset(tvb, offset, MIN((int)bc, tvb_captured_length_remaining(tvb, offset)), bc);
if (nti) {
dissect_smb2_ioctl_data(ioctl_tvb, pinfo, tree, top_tree_global, nti->ioctl_function, TRUE);
}
@@ -9113,7 +9113,7 @@ dissect_nt_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (pd_tvb) {
/* we have reassembled data, grab param and data from there */
dissect_nt_trans_param_request(pd_tvb, pinfo, 0, tree, tp,
- &ntd, (guint16) tvb_length(pd_tvb), nti, si);
+ &ntd, (guint16) tvb_captured_length(pd_tvb), nti, si);
dissect_nt_trans_data_request(pd_tvb, pinfo, tp, tree, td, &ntd, nti, si);
COUNT_BYTES(bc); /* We are done */
} else {
@@ -9202,7 +9202,7 @@ dissect_nt_trans_data_response(tvbuff_t *tvb, packet_info *pinfo,
break;
case NT_TRANS_IOCTL:
/* ioctl data */
- ioctl_tvb = tvb_new_subset(tvb, offset, MIN((int)len, tvb_length_remaining(tvb, offset)), len);
+ ioctl_tvb = tvb_new_subset(tvb, offset, MIN((int)len, tvb_captured_length_remaining(tvb, offset)), len);
dissect_smb2_ioctl_data(ioctl_tvb, pinfo, tree, top_tree_global, nti->ioctl_function, FALSE);
offset += len;
@@ -9655,7 +9655,7 @@ dissect_nt_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if (pd_tvb) {
/* we have reassembled data, grab param and data from there */
dissect_nt_trans_param_response(pd_tvb, pinfo, 0, tree, tp,
- &ntd, (guint16) tvb_length(pd_tvb), si);
+ &ntd, (guint16) tvb_captured_length(pd_tvb), si);
dissect_nt_trans_data_response(pd_tvb, pinfo, tp, tree, td, &ntd, nti, si);
COUNT_BYTES(bc); /* We are done */
} else {
@@ -13489,7 +13489,7 @@ dissect_sfsi_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
/* security blob */
blob_item = proto_tree_add_item(tree, hf_smb_security_blob,
tvb, offset,
- tvb_length_remaining(tvb, offset),
+ tvb_captured_length_remaining(tvb, offset),
ENC_NA);
/* As an optimization, because Windows is perverse,
@@ -13511,7 +13511,7 @@ dissect_sfsi_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
call_dissector(gssapi_handle, blob_tvb, pinfo, blob_tree);
}
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
*bcp = 0;
break;
}
@@ -13542,7 +13542,7 @@ dissect_sfsi_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
/* security blob */
blob_item = proto_tree_add_item(tree, hf_smb_security_blob,
tvb, offset,
- tvb_length_remaining(tvb, offset),
+ tvb_captured_length_remaining(tvb, offset),
ENC_NA);
/* As an optimization, because Windows is perverse,
@@ -13564,7 +13564,7 @@ dissect_sfsi_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
call_dissector(gssapi_handle, blob_tvb, pinfo, blob_tree);
}
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
*bcp = 0;
break;
}
@@ -14054,8 +14054,8 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvbuff_t *sp_tvb, *pd_tvb;
if (pc > 0) {
- if (pc>tvb_length_remaining(tvb, po)) {
- p_tvb = tvb_new_subset(tvb, po, tvb_length_remaining(tvb, po), pc);
+ if (pc>tvb_captured_length_remaining(tvb, po)) {
+ p_tvb = tvb_new_subset(tvb, po, tvb_captured_length_remaining(tvb, po), pc);
} else {
p_tvb = tvb_new_subset_length(tvb, po, pc);
}
@@ -14063,8 +14063,8 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
p_tvb = NULL;
}
if (dc > 0) {
- if (dc>tvb_length_remaining(tvb, od)) {
- d_tvb = tvb_new_subset(tvb, od, tvb_length_remaining(tvb, od), dc);
+ if (dc>tvb_captured_length_remaining(tvb, od)) {
+ d_tvb = tvb_new_subset(tvb, od, tvb_captured_length_remaining(tvb, od), dc);
} else {
d_tvb = tvb_new_subset_length(tvb, od, dc);
}
@@ -14072,8 +14072,8 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
d_tvb = NULL;
}
if (sl) {
- if (sl>tvb_length_remaining(tvb, so)) {
- s_tvb = tvb_new_subset(tvb, so, tvb_length_remaining(tvb, so), sl);
+ if (sl>tvb_captured_length_remaining(tvb, so)) {
+ s_tvb = tvb_new_subset(tvb, so, tvb_captured_length_remaining(tvb, so), sl);
} else {
s_tvb = tvb_new_subset_length(tvb, so, sl);
}
@@ -16630,8 +16630,8 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* if there were any setup bytes, put them in a tvb for later */
if (sc) {
- if ((2*sc) > tvb_length_remaining(tvb, offset)) {
- s_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), 2*sc);
+ if ((2*sc) > tvb_captured_length_remaining(tvb, offset)) {
+ s_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), 2*sc);
} else {
s_tvb = tvb_new_subset_length(tvb, offset, 2*sc);
}
@@ -16700,12 +16700,12 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if ( (pd == 0) && (dd == 0) ) {
int min;
int reported_min;
- min = MIN(pc, tvb_length_remaining(tvb, po));
+ min = MIN(pc, tvb_captured_length_remaining(tvb, po));
reported_min = MIN(pc, tvb_reported_length_remaining(tvb, po));
if (min && reported_min) {
p_tvb = tvb_new_subset(tvb, po, min, reported_min);
}
- min = MIN(dc, tvb_length_remaining(tvb, od));
+ min = MIN(dc, tvb_captured_length_remaining(tvb, od));
reported_min = MIN(dc, tvb_reported_length_remaining(tvb, od));
if (min && reported_min) {
d_tvb = tvb_new_subset(tvb, od, min, reported_min);
@@ -16715,7 +16715,7 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
* and the data.
* XXX - check pc and dc as well?
*/
- if (tvb_length_remaining(tvb, po)) {
+ if (tvb_captured_length_remaining(tvb, po)) {
pd_tvb = tvb_new_subset_remaining(tvb, po);
}
}
@@ -18203,7 +18203,7 @@ static gboolean
dissect_smb_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
{
/* must check that this really is a smb packet */
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return FALSE;
if ( (tvb_get_guint8(tvb, 0) != 0xff)
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index aa4e3dc324..f50ff3292b 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -917,14 +917,14 @@ dissect_smb2_olb_string(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *t
offset = olb->off;
len = olb->len;
off = olb->off;
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
/* sanity check */
tvb_ensure_bytes_exist(tvb, off, len);
if (((off+len)<off)
|| ((off+len)>(off+tvb_reported_length_remaining(tvb, off)))) {
- proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset),
"Invalid offset/length. Malformed packet");
col_append_str(pinfo->cinfo, COL_INFO, " [Malformed packet]");
@@ -999,7 +999,7 @@ dissect_smb2_olb_buffer(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *t
tvb_ensure_bytes_exist(tvb, off, len);
if (((off+len)<off)
|| ((off+len)>(off+tvb_reported_length_remaining(tvb, off)))) {
- proto_tree_add_text(parent_tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(parent_tree, tvb, offset, tvb_captured_length_remaining(tvb, offset),
"Invalid offset/length. Malformed packet");
col_append_str(pinfo->cinfo, COL_INFO, " [Malformed packet]");
@@ -1046,7 +1046,7 @@ dissect_smb2_olb_buffer(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *t
return;
}
- sub_tvb = tvb_new_subset(tvb, off, MIN((int)len, tvb_length_remaining(tvb, off)), len);
+ sub_tvb = tvb_new_subset(tvb, off, MIN((int)len, tvb_captured_length_remaining(tvb, off)), len);
dissector(sub_tvb, pinfo, sub_tree, si);
}
@@ -1546,7 +1546,7 @@ dissect_smb2_file_all_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pa
/* file name */
if (length) {
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
name = get_unicode_or_ascii_string(tvb, &offset,
TRUE, &length, TRUE, TRUE, &bc);
if (name) {
@@ -1575,7 +1575,7 @@ dissect_smb2_file_allocation_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
tree = proto_item_add_subtree(item, ett_smb2_file_allocation_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qsfi_SMB_FILE_ALLOCATION_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1594,7 +1594,7 @@ dissect_smb2_file_endoffile_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
tree = proto_item_add_subtree(item, ett_smb2_file_endoffile_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qsfi_SMB_FILE_ENDOFFILE_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1613,7 +1613,7 @@ dissect_smb2_file_alternate_name_info(tvbuff_t *tvb, packet_info *pinfo _U_, pro
tree = proto_item_add_subtree(item, ett_smb2_file_alternate_name_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_NAME_INFO(tvb, pinfo, tree, offset, &bc, &trunc, /* XXX assumption hack */ TRUE);
return offset;
@@ -1666,7 +1666,7 @@ dissect_smb2_file_standard_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
tree = proto_item_add_subtree(item, ett_smb2_file_standard_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_STANDARD_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1684,7 +1684,7 @@ dissect_smb2_file_internal_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
tree = proto_item_add_subtree(item, ett_smb2_file_internal_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_INTERNAL_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1702,7 +1702,7 @@ dissect_smb2_file_mode_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *p
tree = proto_item_add_subtree(item, ett_smb2_file_mode_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qsfi_SMB_FILE_MODE_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1720,7 +1720,7 @@ dissect_smb2_file_alignment_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
tree = proto_item_add_subtree(item, ett_smb2_file_alignment_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_ALIGNMENT_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1738,7 +1738,7 @@ dissect_smb2_file_position_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
tree = proto_item_add_subtree(item, ett_smb2_file_position_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qsfi_SMB_FILE_POSITION_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1774,7 +1774,7 @@ dissect_smb2_file_ea_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *par
tree = proto_item_add_subtree(item, ett_smb2_file_ea_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_EA_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1793,7 +1793,7 @@ dissect_smb2_file_stream_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
tree = proto_item_add_subtree(item, ett_smb2_file_stream_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_STREAM_INFO(tvb, pinfo, tree, offset, &bc, &trunc, TRUE);
return offset;
@@ -1812,7 +1812,7 @@ dissect_smb2_file_pipe_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *p
tree = proto_item_add_subtree(item, ett_smb2_file_pipe_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_sfi_SMB_FILE_PIPE_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1831,7 +1831,7 @@ dissect_smb2_file_compression_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_
tree = proto_item_add_subtree(item, ett_smb2_file_compression_info);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_COMPRESSION_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1851,7 +1851,7 @@ dissect_smb2_file_network_open_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_NETWORK_OPEN_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1871,7 +1871,7 @@ dissect_smb2_file_attribute_tag_info(tvbuff_t *tvb, packet_info *pinfo _U_, prot
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfi_SMB_FILE_ATTRIBUTE_TAG_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
return offset;
@@ -1949,7 +1949,7 @@ dissect_smb2_file_full_ea_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* ea name */
length = ea_name_len;
if (length) {
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
name = get_unicode_or_ascii_string(tvb, &offset,
FALSE, &length, TRUE, TRUE, &bc);
if (name) {
@@ -1964,7 +1964,7 @@ dissect_smb2_file_full_ea_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* ea data */
length = ea_data_len;
if (length) {
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
data = get_unicode_or_ascii_string(tvb, &offset,
FALSE, &length, TRUE, TRUE, &bc);
/*
@@ -2022,7 +2022,7 @@ dissect_smb2_file_rename_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* file name */
if (length) {
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
name = get_unicode_or_ascii_string(tvb, &offset,
TRUE, &length, TRUE, TRUE, &bc);
if (name) {
@@ -2053,7 +2053,7 @@ dissect_smb2_sec_info_00(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pare
}
/* security descriptor */
- offset = dissect_nt_sec_desc(tvb, offset, pinfo, tree, NULL, TRUE, tvb_length_remaining(tvb, offset), NULL);
+ offset = dissect_nt_sec_desc(tvb, offset, pinfo, tree, NULL, TRUE, tvb_captured_length_remaining(tvb, offset), NULL);
return offset;
}
@@ -2070,7 +2070,7 @@ dissect_smb2_fs_info_05(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *paren
tree = proto_item_add_subtree(item, ett_smb2_fs_info_05);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfsi_FS_ATTRIBUTE_INFO(tvb, pinfo, tree, offset, &bc, TRUE);
return offset;
@@ -2088,7 +2088,7 @@ dissect_smb2_fs_info_06(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *paren
tree = proto_item_add_subtree(item, ett_smb2_fs_info_06);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_nt_quota(tvb, tree, offset, &bc);
return offset;
@@ -2123,7 +2123,7 @@ dissect_smb2_fs_info_07(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *paren
tree = proto_item_add_subtree(item, ett_smb2_fs_info_07);
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfsi_FS_FULL_SIZE_INFO(tvb, pinfo, tree, offset, &bc);
return offset;
@@ -2142,7 +2142,7 @@ dissect_smb2_fs_info_01(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *paren
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfsi_FS_VOLUME_INFO(tvb, pinfo, tree, offset, &bc, TRUE);
return offset;
@@ -2161,7 +2161,7 @@ dissect_smb2_fs_info_03(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *paren
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfsi_FS_SIZE_INFO(tvb, pinfo, tree, offset, &bc);
return offset;
@@ -2180,7 +2180,7 @@ dissect_smb2_fs_info_04(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *paren
}
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
offset = dissect_qfsi_FS_DEVICE_INFO(tvb, pinfo, tree, offset, &bc);
return offset;
@@ -2412,7 +2412,7 @@ dissect_smb2_share_caps(proto_tree *tree, tvbuff_t *tvb, int offset)
static void
dissect_smb2_secblob(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, smb2_info_t *si _U_)
{
- if ((tvb_length(tvb)>=7)
+ if ((tvb_captured_length(tvb)>=7)
&& (!tvb_memeql(tvb, 0, "NTLMSSP", 7))) {
call_dissector(ntlmssp_handle, tvb, pinfo, tree);
} else {
@@ -2820,7 +2820,7 @@ dissect_smb2_notify_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static void
dissect_smb2_notify_data_out(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, smb2_info_t *si _U_)
{
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_length(tvb), ENC_NA);
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_captured_length(tvb), ENC_NA);
}
static int
@@ -2921,7 +2921,7 @@ static void dissect_smb2_file_directory_info(tvbuff_t *tvb, packet_info *pinfo _
const char *name = NULL;
guint16 bc;
- while (tvb_length_remaining(tvb, offset) > 4) {
+ while (tvb_captured_length_remaining(tvb, offset) > 4) {
int old_offset = offset;
int next_offset;
int file_name_len;
@@ -2989,7 +2989,7 @@ static void dissect_smb2_file_directory_info(tvbuff_t *tvb, packet_info *pinfo _
offset = old_offset+next_offset;
if (offset < old_offset) {
- proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset),
"Invalid offset/length. Malformed packet");
return;
}
@@ -3004,7 +3004,7 @@ static void dissect_smb2_full_directory_info(tvbuff_t *tvb, packet_info *pinfo _
const char *name = NULL;
guint16 bc;
- while (tvb_length_remaining(tvb, offset) > 4) {
+ while (tvb_captured_length_remaining(tvb, offset) > 4) {
int old_offset = offset;
int next_offset;
int file_name_len;
@@ -3076,7 +3076,7 @@ static void dissect_smb2_full_directory_info(tvbuff_t *tvb, packet_info *pinfo _
offset = old_offset+next_offset;
if (offset < old_offset) {
- proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset),
"Invalid offset/length. Malformed packet");
return;
}
@@ -3091,7 +3091,7 @@ static void dissect_smb2_both_directory_info(tvbuff_t *tvb, packet_info *pinfo _
const char *name = NULL;
guint16 bc;
- while (tvb_length_remaining(tvb, offset) > 4) {
+ while (tvb_captured_length_remaining(tvb, offset) > 4) {
int old_offset = offset;
int next_offset;
int file_name_len;
@@ -3184,7 +3184,7 @@ static void dissect_smb2_both_directory_info(tvbuff_t *tvb, packet_info *pinfo _
offset = old_offset+next_offset;
if (offset < old_offset) {
- proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset),
"Invalid offset/length. Malformed packet");
return;
}
@@ -3199,7 +3199,7 @@ static void dissect_smb2_file_name_info(tvbuff_t *tvb, packet_info *pinfo _U_, p
const char *name = NULL;
guint16 bc;
- while (tvb_length_remaining(tvb, offset) > 4) {
+ while (tvb_captured_length_remaining(tvb, offset) > 4) {
int old_offset = offset;
int next_offset;
int file_name_len;
@@ -3244,7 +3244,7 @@ static void dissect_smb2_file_name_info(tvbuff_t *tvb, packet_info *pinfo _U_, p
offset = old_offset+next_offset;
if (offset < old_offset) {
- proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset),
"Invalid offset/length. Malformed packet");
return;
}
@@ -3259,7 +3259,7 @@ static void dissect_smb2_id_both_directory_info(tvbuff_t *tvb, packet_info *pinf
const char *name = NULL;
guint16 bc;
- while (tvb_length_remaining(tvb, offset) > 4) {
+ while (tvb_captured_length_remaining(tvb, offset) > 4) {
int old_offset = offset;
int next_offset;
int file_name_len;
@@ -3359,7 +3359,7 @@ static void dissect_smb2_id_both_directory_info(tvbuff_t *tvb, packet_info *pinf
offset = old_offset+next_offset;
if (offset < old_offset) {
- proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset),
"Invalid offset/length. Malformed packet");
return;
}
@@ -3396,7 +3396,7 @@ dissect_smb2_find_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, smb2
dis++;
}
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_length(tvb), ENC_NA);
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_captured_length(tvb), ENC_NA);
}
static int
@@ -3554,7 +3554,7 @@ dissect_smb2_getinfo_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
default:
/* we dont handle this infolevel yet */
proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 16, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
case SMB2_CLASS_FS_INFO:
@@ -3562,7 +3562,7 @@ dissect_smb2_getinfo_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
default:
/* we dont handle this infolevel yet */
proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 16, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
case SMB2_CLASS_SEC_INFO:
@@ -3573,13 +3573,13 @@ dissect_smb2_getinfo_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
default:
/* we dont handle this infolevel yet */
proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 16, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
default:
/* we dont handle this class yet */
proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 16, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
}
@@ -3751,8 +3751,8 @@ dissect_smb2_infolevel(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
break;
default:
/* we dont handle this infolevel yet */
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
case SMB2_CLASS_FS_INFO:
@@ -3780,8 +3780,8 @@ dissect_smb2_infolevel(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
break;
default:
/* we dont handle this infolevel yet */
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
case SMB2_CLASS_SEC_INFO:
@@ -3791,14 +3791,14 @@ dissect_smb2_infolevel(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
break;
default:
/* we dont handle this infolevel yet */
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
default:
/* we dont handle this class yet */
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
/* if we get BUFFER_OVERFLOW there will be truncated data */
@@ -3818,7 +3818,7 @@ dissect_smb2_getinfo_response_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree
dissect_smb2_infolevel(tvb, pinfo, tree, 0, si, si->saved->smb2_class, si->saved->infolevel);
} else {
/* some unknown bytes */
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_length(tvb), ENC_NA);
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_captured_length(tvb), ENC_NA);
}
}
@@ -4064,7 +4064,7 @@ dissect_file_data_dcerpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_
tvbuff_t *dcerpc_tvb;
heur_dtbl_entry_t *hdtbl_entry;
- dcerpc_tvb = tvb_new_subset(tvb, offset, MIN((int)datalen, tvb_length_remaining(tvb, offset)), datalen);
+ dcerpc_tvb = tvb_new_subset(tvb, offset, MIN((int)datalen, tvb_captured_length_remaining(tvb, offset)), datalen);
/* dissect the full PDU */
dissector_try_heuristic(smb2_heur_subdissector_list, dcerpc_tvb, pinfo, top_tree, &hdtbl_entry, NULL);
@@ -4204,9 +4204,9 @@ dissect_smb2_write_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* just ordinary data */
proto_tree_add_item(tree, hf_smb2_write_data, tvb, offset, length, ENC_NA);
- data_tvb_len=(guint32)tvb_length_remaining(tvb, offset);
+ data_tvb_len=(guint32)tvb_captured_length_remaining(tvb, offset);
- offset += MIN(length,(guint32)tvb_length_remaining(tvb, offset));
+ offset += MIN(length,(guint32)tvb_captured_length_remaining(tvb, offset));
offset = dissect_smb2_olb_tvb_max_offset(offset, &c_olb);
@@ -4257,7 +4257,7 @@ dissect_smb2_write_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
static void
dissect_smb2_FSCTL_PIPE_TRANSCEIVE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *top_tree, gboolean data_in _U_)
{
- dissect_file_data_dcerpc(tvb, pinfo, tree, offset, tvb_length_remaining(tvb, offset), top_tree);
+ dissect_file_data_dcerpc(tvb, pinfo, tree, offset, tvb_captured_length_remaining(tvb, offset), top_tree);
}
static void
@@ -4611,7 +4611,7 @@ dissect_smb2_FSCTL_GET_SHADOW_COPY_DATA(tvbuff_t *tvb, packet_info *pinfo _U_, p
int len = 0;
int old_offset = offset;
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
name = get_unicode_or_ascii_string(tvb, &offset,
TRUE, &len, TRUE, FALSE, &bc);
proto_tree_add_string(tree, hf_smb2_ioctl_shadow_copy_label, tvb, old_offset, len, name);
@@ -4792,7 +4792,7 @@ dissect_smb2_ioctl_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro
dissect_smb2_FSCTL_SET_COMPRESSION(tvb, pinfo, tree, 0, data_in);
break;
default:
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_length(tvb), ENC_NA);
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_captured_length(tvb), ENC_NA);
}
}
@@ -5046,7 +5046,7 @@ dissect_smb2_read_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* data */
proto_tree_add_item(tree, hf_smb2_read_data, tvb, offset, length, ENC_NA);
- data_tvb_len=(guint32)tvb_length_remaining(tvb, offset);
+ data_tvb_len=(guint32)tvb_captured_length_remaining(tvb, offset);
offset += MIN(length,data_tvb_len);
@@ -5062,7 +5062,7 @@ dissect_smb2_read_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static void
report_create_context_malformed_buffer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, const char *buffer_desc)
{
- proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, 0),
+ proto_tree_add_text(tree, tvb, 0, tvb_captured_length_remaining(tvb, 0),
"%s SHOULD NOT be generated. Malformed packet", buffer_desc);
}
static void
@@ -5126,7 +5126,7 @@ dissect_smb2_QFid_buffer_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
}
if (item) {
- if (tvb_length(tvb) == 0) {
+ if (tvb_captured_length(tvb) == 0) {
proto_item_append_text(item, ": NO DATA");
} else {
proto_item_append_text(item, ": QFid request should have no data, malformed packet");
@@ -5323,7 +5323,7 @@ dissect_smb2_MxAc_buffer_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
item = proto_tree_get_parent(tree);
}
- if (tvb_length(tvb) == 0) {
+ if (tvb_captured_length(tvb) == 0) {
if (item) {
proto_item_append_text(item, ": NO DATA");
}
@@ -5349,7 +5349,7 @@ dissect_smb2_MxAc_buffer_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
item = proto_tree_get_parent(tree);
}
- if (tvb_length(tvb) == 0) {
+ if (tvb_captured_length(tvb) == 0) {
if (item) {
proto_item_append_text(item, ": NO DATA");
}
@@ -5418,7 +5418,7 @@ dissect_SMB2_CREATE_LEASE_VX(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
parent_item = proto_tree_get_parent(parent_tree);
}
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
switch (len) {
case 32: /* SMB2_CREATE_REQUEST/RESPONSE_LEASE */
@@ -6780,7 +6780,7 @@ dissect_smb2_command(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int of
offset = (*cmd_dissector)(tvb, pinfo, cmd_tree, offset, si);
} else {
proto_tree_add_item(cmd_tree, hf_smb2_unknown, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
proto_item_set_len(cmd_item, offset-old_offset);
@@ -7205,7 +7205,7 @@ dissect_smb2_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, vo
{
/* must check that this really is a smb2 packet */
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return FALSE;
if (((tvb_get_guint8(tvb, 0) != 0xfe) && (tvb_get_guint8(tvb, 0) != 0xfd))
diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c
index 5ae1054583..606ba21bc4 100644
--- a/epan/dissectors/packet-smpp.c
+++ b/epan/dissectors/packet-smpp.c
@@ -2411,7 +2411,7 @@ dissect_smpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
guint32 offset = 0;
while (tvb_reported_length_remaining(tvb, offset) > 0) {
guint16 pdu_len = tvb_get_ntohl(tvb, offset);
- gint pdu_real_len = tvb_length_remaining(tvb, offset);
+ gint pdu_real_len = tvb_captured_length_remaining(tvb, offset);
tvbuff_t *pdu_tvb;
if (pdu_len < 1)
@@ -2428,7 +2428,7 @@ dissect_smpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -2486,7 +2486,7 @@ dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
* Create display subtree for the protocol
*/
if (tree) {
- ti = proto_tree_add_item (tree, proto_smpp, tvb, 0, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item (tree, proto_smpp, tvb, 0, tvb_captured_length(tvb), ENC_NA);
smpp_tree = proto_item_add_subtree (ti, ett_smpp);
}
@@ -2524,13 +2524,13 @@ dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
* Physical length: at most command_length
* Reported length: command_length
*/
- if (tvb_length_remaining(tvb, offset - 16 + command_length) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset - 16 + command_length) > 0) {
pdu_tvb = tvb_new_subset(tvb, offset - 16,
command_length, /* Physical length */
command_length); /* Length reported by the protocol */
} else {
pdu_tvb = tvb_new_subset(tvb, offset - 16,
- tvb_length_remaining(tvb, offset - 16),/* Physical length */
+ tvb_captured_length_remaining(tvb, offset - 16),/* Physical length */
command_length); /* Length reported by the protocol */
}
@@ -2729,7 +2729,7 @@ dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
first = FALSE;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c
index 8a3d6ef63a..b2344695ab 100644
--- a/epan/dissectors/packet-smtp.c
+++ b/epan/dissectors/packet-smtp.c
@@ -486,7 +486,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
return;
} else {
- linelen = tvb_length_remaining(tvb, loffset);
+ linelen = tvb_captured_length_remaining(tvb, loffset);
next_offset = loffset + linelen;
}
}
@@ -507,7 +507,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_strneql(tvb, loffset, "\r\n.\r\n", 5) == 0)
eom_seen = TRUE;
- length_remaining = tvb_length_remaining(tvb, loffset);
+ length_remaining = tvb_captured_length_remaining(tvb, loffset);
if (length_remaining == tvb_reported_length_remaining(tvb, loffset) &&
tvb_strneql(tvb, loffset + length_remaining - 2, "\r\n", 2) == 0)
session_state->crlf_seen = TRUE;
@@ -543,7 +543,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* We are handling a BDAT message.
* Check if we have reached end of the data chunk.
*/
- session_state->msg_read_len += tvb_length_remaining(tvb, loffset);
+ session_state->msg_read_len += tvb_captured_length_remaining(tvb, loffset);
if (session_state->msg_read_len == session_state->msg_tot_len) {
/*
@@ -759,7 +759,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case SMTP_PDU_MESSAGE:
/* Column Info */
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
col_set_str(pinfo->cinfo, COL_INFO, smtp_data_desegment ? "C: DATA fragment" : "C: Message Body");
col_append_fstr(pinfo->cinfo, COL_INFO, ", %d byte%s", length_remaining,
plurality (length_remaining, "", "s"));
@@ -767,7 +767,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (smtp_data_desegment) {
frag_msg = fragment_add_seq_next(&smtp_data_reassembly_table, tvb, 0,
pinfo, spd_frame_data->conversation_id, NULL,
- tvb_length(tvb), spd_frame_data->more_frags);
+ tvb_captured_length(tvb), spd_frame_data->more_frags);
} else {
/*
* Message body.
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c
index fa460ca173..6be7dfd970 100644
--- a/epan/dissectors/packet-sna.c
+++ b/epan/dissectors/packet-sna.c
@@ -2406,7 +2406,7 @@ dissect_control(tvbuff_t *parent_tvb, int offset, int control_len,
int len, key;
gint ett;
- length = tvb_length_remaining(parent_tvb, offset);
+ length = tvb_captured_length_remaining(parent_tvb, offset);
reported_length = tvb_reported_length_remaining(parent_tvb, offset);
if (control_len < length)
length = control_len;
diff --git a/epan/dissectors/packet-sndcp.c b/epan/dissectors/packet-sndcp.c
index c19b48a110..85c0b1e980 100644
--- a/epan/dissectors/packet-sndcp.c
+++ b/epan/dissectors/packet-sndcp.c
@@ -321,7 +321,7 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint32 reassembled_in = 0;
gboolean save_fragmented = pinfo->fragmented;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if(len<=0){
return;
}
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index d8f6f14f77..8b2d6bc2c1 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -459,7 +459,7 @@ dissect_snmp_variable_string(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
proto_tree_add_item(tree, hf_snmp_var_bind_str, tvb, 0, -1, ENC_ASCII|ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -1614,8 +1614,8 @@ get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb)
if (! ( user_tvb && engine_tvb ) ) return NULL;
- given_username_len = tvb_length(user_tvb);
- given_engine_len = tvb_length(engine_tvb);
+ given_username_len = tvb_captured_length(user_tvb);
+ given_engine_len = tvb_captured_length(engine_tvb);
if (! ( given_engine_len && given_username_len ) ) return NULL;
given_username = (guint8*)tvb_memdup(wmem_packet_scope(),user_tvb,0,-1);
given_engine = (guint8*)tvb_memdup(wmem_packet_scope(),engine_tvb,0,-1);
@@ -1665,14 +1665,14 @@ snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, guint* calc_auth_l
}
- auth_len = tvb_length_remaining(p->auth_tvb,0);
+ auth_len = tvb_captured_length_remaining(p->auth_tvb,0);
if (auth_len != 12) {
*error = "Authenticator length wrong";
return FALSE;
}
- msg_len = tvb_length_remaining(p->msg_tvb,0);
+ msg_len = tvb_captured_length_remaining(p->msg_tvb,0);
if (msg_len <= 0) {
*error = "Not enough data remaining";
return FALSE;
@@ -1729,7 +1729,7 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a
}
- auth_len = tvb_length_remaining(p->auth_tvb,0);
+ auth_len = tvb_captured_length_remaining(p->auth_tvb,0);
if (auth_len != 12) {
@@ -1737,7 +1737,7 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a
return FALSE;
}
- msg_len = tvb_length_remaining(p->msg_tvb,0);
+ msg_len = tvb_captured_length_remaining(p->msg_tvb,0);
if (msg_len <= 0) {
*error = "Not enough data remaining";
return FALSE;
@@ -1783,7 +1783,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
guint i;
- salt_len = tvb_length_remaining(p->priv_tvb,0);
+ salt_len = tvb_captured_length_remaining(p->priv_tvb,0);
if (salt_len != 8) {
*error = "decryptionError: msgPrivacyParameters length != 8";
@@ -1799,7 +1799,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
iv[i] = pre_iv[i] ^ salt[i];
}
- cryptgrm_len = tvb_length_remaining(encryptedData,0);
+ cryptgrm_len = tvb_captured_length_remaining(encryptedData,0);
if ((cryptgrm_len <= 0) || (cryptgrm_len % 8)) {
*error = "decryptionError: the length of the encrypted data is not a mutiple of 8 octets";
@@ -1856,7 +1856,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
guint8* cryptgrm;
tvbuff_t* clear_tvb;
- priv_len = tvb_length_remaining(p->priv_tvb,0);
+ priv_len = tvb_captured_length_remaining(p->priv_tvb,0);
if (priv_len != 8) {
*error = "decryptionError: msgPrivacyParameters length != 8";
@@ -1873,7 +1873,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
iv[7] = (p->time & 0x000000ff);
tvb_memcpy(p->priv_tvb,&(iv[8]),0,8);
- cryptgrm_len = tvb_length_remaining(encryptedData,0);
+ cryptgrm_len = tvb_captured_length_remaining(encryptedData,0);
if (cryptgrm_len <= 0) {
*error = "Not enough data remaining";
return NULL;
@@ -2483,7 +2483,7 @@ dissect_snmp_SnmpEngineID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
&param_tvb);
if (param_tvb) {
proto_tree* engine_tree = proto_item_add_subtree(actx->created_item,ett_engineid);
- dissect_snmp_engineid(engine_tree, param_tvb, 0, tvb_length_remaining(param_tvb,0));
+ dissect_snmp_engineid(engine_tree, param_tvb, 0, tvb_captured_length_remaining(param_tvb,0));
}
@@ -2501,7 +2501,7 @@ dissect_snmp_T_msgAuthoritativeEngineID(gboolean implicit_tag _U_, tvbuff_t *tvb
&usm_p.engine_tvb);
if (usm_p.engine_tvb) {
proto_tree* engine_tree = proto_item_add_subtree(actx->created_item,ett_engineid);
- dissect_snmp_engineid(engine_tree, usm_p.engine_tvb, 0, tvb_length_remaining(usm_p.engine_tvb,0));
+ dissect_snmp_engineid(engine_tree, usm_p.engine_tvb, 0, tvb_captured_length_remaining(usm_p.engine_tvb,0));
}
diff --git a/epan/dissectors/packet-socks.c b/epan/dissectors/packet-socks.c
index e692558604..696cb40c69 100644
--- a/epan/dissectors/packet-socks.c
+++ b/epan/dissectors/packet-socks.c
@@ -907,7 +907,7 @@ display_ping_and_tracert(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
"Traceroute Results");
data = tvb_get_ptr(tvb, offset, -1);
- dataend = data + tvb_length_remaining(tvb, offset);
+ dataend = data + tvb_captured_length_remaining(tvb, offset);
while (data < dataend) {
diff --git a/epan/dissectors/packet-soupbintcp.c b/epan/dissectors/packet-soupbintcp.c
index 04337dd437..a284b80541 100644
--- a/epan/dissectors/packet-soupbintcp.c
+++ b/epan/dissectors/packet-soupbintcp.c
@@ -470,7 +470,7 @@ dissect_soupbintcp_tcp_pdu(
void *data _U_)
{
dissect_soupbintcp_common(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -486,7 +486,7 @@ dissect_soupbintcp_tcp(
soupbintcp_desegment, 2,
get_soupbintcp_pdu_len,
dissect_soupbintcp_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-spice.c b/epan/dissectors/packet-spice.c
index 951c2ec500..56a53f9e39 100644
--- a/epan/dissectors/packet-spice.c
+++ b/epan/dissectors/packet-spice.c
@@ -3157,7 +3157,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
break;
case SPICE_SASL_INIT_FROM_SERVER:
offset = 0;
- avail = tvb_length_remaining(tvb, offset);
+ avail = tvb_captured_length_remaining(tvb, offset);
pdu_len = 4;
GET_PDU_FROM_OFFSET(offset)
pdu_len = tvb_get_letohl(tvb, offset); /* the length of the following messages */
@@ -3182,7 +3182,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
case SPICE_SASL_START_TO_SERVER:
offset = 0;
while (offset < tvb_reported_length(tvb)) {
- avail = tvb_length_remaining(tvb, offset);
+ avail = tvb_captured_length_remaining(tvb, offset);
pdu_len = 4;
GET_PDU_FROM_OFFSET(offset)
pdu_len = tvb_get_letohl(tvb, offset); /* the length of the following messages */
@@ -3228,7 +3228,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
case SPICE_SASL_STEP_FROM_SERVER:
offset = 0;
while (offset < tvb_reported_length(tvb)) {
- avail = tvb_length_remaining(tvb, offset);
+ avail = tvb_captured_length_remaining(tvb, offset);
pdu_len = 4;
GET_PDU_FROM_OFFSET(offset)
pdu_len = tvb_get_letohl(tvb, offset); /* the length of the following messages */
@@ -3264,7 +3264,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
case SPICE_SASL_START_FROM_SERVER_CONT:
case SPICE_SASL_STEP_FROM_SERVER_CONT:
offset = 0;
- avail = tvb_length_remaining(tvb, offset);
+ avail = tvb_captured_length_remaining(tvb, offset);
if (avail >= 1) {
if (tree && spice_tree == NULL) {
ti = proto_tree_add_item(tree, proto_spice, tvb, offset, 1, ENC_NA);
@@ -3293,7 +3293,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
case SPICE_SASL_STEP_TO_SERVER:
offset = 0;
while (offset < tvb_reported_length(tvb)) {
- avail = tvb_length_remaining(tvb, offset);
+ avail = tvb_captured_length_remaining(tvb, offset);
pdu_len = 4;
GET_PDU_FROM_OFFSET(offset)
pdu_len = tvb_get_letohl(tvb, offset); /* the length of the following messages */
@@ -3328,7 +3328,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
case SPICE_SASL_DATA:
offset = 0;
while (offset < tvb_reported_length(tvb)) {
- avail = tvb_length_remaining(tvb, offset);
+ avail = tvb_captured_length_remaining(tvb, offset);
pdu_len = 4;
GET_PDU_FROM_OFFSET(offset)
pdu_len = tvb_get_ntohl(tvb, offset); /* the length of the following messages */
@@ -3357,7 +3357,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
case SPICE_DATA:
offset = 0;
while (offset < tvb_reported_length(tvb)) {
- avail = tvb_length_remaining(tvb, offset);
+ avail = tvb_captured_length_remaining(tvb, offset);
if (spice_info->client_mini_header && spice_info->server_mini_header) {
pdu_len = sizeof_SpiceMiniDataHeader;
GET_PDU_FROM_OFFSET(offset)
diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c
index 469adf8e72..498a174ee6 100644
--- a/epan/dissectors/packet-spnego.c
+++ b/epan/dissectors/packet-spnego.c
@@ -521,11 +521,11 @@ dissect_spnego_InnerContextToken(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i
len = call_dissector(next_level_value_lcl->wrap_handle, token_tvb, actx->pinfo,
subtree);
if (len == 0)
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
else
offset = offset + len;
} else
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
@@ -916,7 +916,7 @@ decrypt_arcfour(packet_info *pinfo,
int conf_flag;
int padlen = 0;
- datalen = tvb_length(pinfo->gssapi_encrypted_tvb);
+ datalen = tvb_captured_length(pinfo->gssapi_encrypted_tvb);
if(tvb_get_ntohs(pinfo->gssapi_wrap_tvb, 4)==0x1000){
conf_flag=1;
@@ -1029,7 +1029,7 @@ decrypt_gssapi_krb_arcfour_wrap(proto_tree *tree, packet_info *pinfo, tvbuff_t *
guint8 *cryptocopy=NULL; /* workaround for pre-0.6.1 heimdal bug */
guint8 *output_message_buffer;
- length=tvb_length(pinfo->gssapi_encrypted_tvb);
+ length=tvb_captured_length(pinfo->gssapi_encrypted_tvb);
original_data=tvb_get_ptr(pinfo->gssapi_encrypted_tvb, 0, length);
/* dont do anything if we are not attempting to decrypt data */
@@ -1144,14 +1144,14 @@ decrypt_gssapi_krb_cfx_wrap(proto_tree *tree _U_,
return;
}
- datalen = tvb_length(checksum_tvb) + tvb_length(encrypted_tvb);
+ datalen = tvb_captured_length(checksum_tvb) + tvb_captured_length(encrypted_tvb);
rotated = (guint8 *)wmem_alloc(pinfo->pool, datalen);
tvb_memcpy(checksum_tvb, rotated,
- 0, tvb_length(checksum_tvb));
- tvb_memcpy(encrypted_tvb, rotated + tvb_length(checksum_tvb),
- 0, tvb_length(encrypted_tvb));
+ 0, tvb_captured_length(checksum_tvb));
+ tvb_memcpy(encrypted_tvb, rotated + tvb_captured_length(checksum_tvb),
+ 0, tvb_captured_length(encrypted_tvb));
if (is_dce) {
rrc += ec;
@@ -1169,13 +1169,13 @@ decrypt_gssapi_krb_cfx_wrap(proto_tree *tree _U_,
if (output) {
guint8 *outdata;
- outdata = (guint8 *)g_memdup(output, tvb_length(encrypted_tvb));
+ outdata = (guint8 *)g_memdup(output, tvb_captured_length(encrypted_tvb));
g_free(output);
pinfo->gssapi_decrypted_tvb=tvb_new_child_real_data(encrypted_tvb,
outdata,
- tvb_length(encrypted_tvb),
- tvb_length(encrypted_tvb));
+ tvb_captured_length(encrypted_tvb),
+ tvb_captured_length(encrypted_tvb));
add_new_data_source(pinfo, pinfo->gssapi_decrypted_tvb, "Decrypted GSS-Krb5");
tvb_set_free_cb(pinfo->gssapi_decrypted_tvb, g_free);
return;
@@ -1274,7 +1274,7 @@ dissect_spnego_krb5_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
if(!pinfo->gssapi_encrypted_tvb){
int len;
len=tvb_reported_length_remaining(tvb,offset);
- if(len>tvb_length_remaining(tvb, offset)){
+ if(len>tvb_captured_length_remaining(tvb, offset)){
/* no point in trying to decrypt,
we dont have the full pdu.
*/
@@ -1368,7 +1368,7 @@ dissect_spnego_krb5_getmic_base(tvbuff_t *tvb, int offset, packet_info *pinfo _U
* so we need to test here if there are more bytes in our tvb or not.
* -- ronnie
*/
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
if (sgn_alg == KRB_SGN_ALG_HMAC) {
proto_tree_add_item(tree, hf_spnego_krb5_confounder, tvb, offset, 8,
ENC_NA);
@@ -1519,7 +1519,7 @@ dissect_spnego_krb5_cfx_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
if(!pinfo->gssapi_encrypted_tvb){
int len;
len=tvb_reported_length_remaining(tvb,offset);
- if(len>tvb_length_remaining(tvb, offset)){
+ if(len>tvb_captured_length_remaining(tvb, offset)){
/* no point in trying to decrypt,
we dont have the full pdu.
*/
@@ -1607,7 +1607,7 @@ dissect_spnego_krb5_cfx_getmic_base(tvbuff_t *tvb, int offset, packet_info *pinf
/* Checksum of plaintext padded data */
- checksum_size = tvb_length_remaining(tvb, offset);
+ checksum_size = tvb_captured_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_spnego_krb5_sgn_cksum, tvb, offset,
checksum_size, ENC_NA);
diff --git a/epan/dissectors/packet-sprt.c b/epan/dissectors/packet-sprt.c
index a5cdad1746..6614ac7fb6 100644
--- a/epan/dissectors/packet-sprt.c
+++ b/epan/dissectors/packet-sprt.c
@@ -1014,7 +1014,7 @@ dissect_sprt_data(tvbuff_t *tvb,
break;
}
offset += 2;
- } while (tvb_length_remaining(tvb, offset) >= 2);
+ } while (tvb_captured_length_remaining(tvb, offset) >= 2);
break;
case SPRT_MODEM_RELAY_MSG_ID_START_JM:
/* No additional content */
@@ -1468,13 +1468,13 @@ dissect_sprt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
col_append_fstr(pinfo->cinfo, COL_INFO, ", Seq=%u", seqnum);
/* dissect the payload, if any */
- payload_length = tvb_length(tvb) - (6 + noa * 2); /* total sprt length - header stuff */
+ payload_length = tvb_captured_length(tvb) - (6 + noa * 2); /* total sprt length - header stuff */
dissect_sprt_data(tvb, pinfo, p_conv_data, sprt_tree, offset, payload_length);
if (noa)
col_append_str(pinfo->cinfo, COL_INFO, " (ACK fields present)");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* heuristic dissector */
@@ -1490,7 +1490,7 @@ dissect_sprt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
* a heuristic dissector called before us!
*/
- if (tvb_length(tvb) < 6)
+ if (tvb_captured_length(tvb) < 6)
return FALSE; /* packet is waay to short */
/* Get the fields in the first two octets */
diff --git a/epan/dissectors/packet-srvloc.c b/epan/dissectors/packet-srvloc.c
index d3d73697b2..4132bb62ea 100644
--- a/epan/dissectors/packet-srvloc.c
+++ b/epan/dissectors/packet-srvloc.c
@@ -538,7 +538,7 @@ attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
while (offset+2<length) {
offset += 2;
/* If the length passed is longer then the actual payload then this must be an incomplete packet. */
- if (tvb_length_remaining(tvb, 4)<length) {
+ if (tvb_captured_length_remaining(tvb, 4)<length) {
proto_tree_add_text(tree, tvb, offset, -1, "Status: Too much data to pass inside this protocol. Resubmit request using a streaming protocol like TCP.");
proto_tree_add_text(tree, tvb, offset, -1, "Note: Protocol dissection is aborted due to packet overflow. See overflow flag.");
break;
@@ -1424,7 +1424,7 @@ dissect_srvloc_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
srvloc_tree = proto_item_add_subtree(ti, ett_srvloc);
}
dissect_srvloc(tvb, pinfo, srvloc_tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1440,7 +1440,7 @@ dissect_srvloc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
*/
tcp_dissect_pdus(tvb, pinfo, tree, srvloc_desegment, 5, get_srvloc_pdu_len,
dissect_srvloc_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register protocol with Wireshark. */
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index df86866212..00c0b0988c 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -852,7 +852,7 @@ dissect_ssl(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");
@@ -1023,7 +1023,7 @@ again:
*/
if (msp->flags & MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT) {
/* The dissector asked for the entire segment */
- len = MAX(0, tvb_length_remaining(tvb, offset));
+ len = MAX(0, tvb_captured_length_remaining(tvb, offset));
} else {
len = MIN(nxtseq, msp->nxtpdu) - seq;
}
@@ -1474,7 +1474,7 @@ dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo,
ti = NULL;
ssl_record_tree = NULL;
- available_bytes = tvb_length_remaining(tvb, offset);
+ available_bytes = tvb_captured_length_remaining(tvb, offset);
/* TLS 1.0/1.1 just ignores unknown records - RFC 2246 chapter 6. The TLS Record Protocol */
if ((session->version==SSL_VER_TLS || session->version==SSL_VER_TLSv1DOT1 || session->version==SSL_VER_TLSv1DOT2) &&
@@ -1716,7 +1716,7 @@ dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo,
/* add desegmented data to the data source list */
add_new_data_source(pinfo, decrypted, "Decrypted SSL record");
dissect_ssl3_handshake(decrypted, pinfo, ssl_record_tree, 0,
- tvb_length(decrypted), session,
+ tvb_captured_length(decrypted), session,
is_from_server, ssl, content_type);
} else {
dissect_ssl3_handshake(tvb, pinfo, ssl_record_tree, offset,
@@ -1770,7 +1770,7 @@ dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo,
decrypted = ssl_get_record_info(tvb, proto_ssl, pinfo, offset);
if (decrypted) {
add_new_data_source(pinfo, decrypted, "Decrypted SSL record");
- dissect_ssl3_heartbeat(decrypted, pinfo, ssl_record_tree, 0, session, tvb_length (decrypted), TRUE);
+ dissect_ssl3_heartbeat(decrypted, pinfo, ssl_record_tree, 0, session, tvb_captured_length (decrypted), TRUE);
} else {
gboolean plaintext = TRUE;
/* heartbeats before ChangeCipherSpec are unencrypted */
@@ -3462,7 +3462,7 @@ dissect_ssl2_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
byte = tvb_get_guint8(tvb, offset);
record_length_length = (byte & 0x80) ? 2 : 3;
- available_bytes = tvb_length_remaining(tvb, offset);
+ available_bytes = tvb_captured_length_remaining(tvb, offset);
/*
* Is the record header split across segment boundaries?
diff --git a/epan/dissectors/packet-stanag4607.c b/epan/dissectors/packet-stanag4607.c
index 38268db036..18f9316214 100644
--- a/epan/dissectors/packet-stanag4607.c
+++ b/epan/dissectors/packet-stanag4607.c
@@ -835,7 +835,7 @@ dissect_stanag4607(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 seg_id = 0;
/* Basic length check */
- if (tvb_length(tvb) < STANAG4607_MIN_LENGTH)
+ if (tvb_captured_length(tvb) < STANAG4607_MIN_LENGTH)
return;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "S4607");
diff --git a/epan/dissectors/packet-starteam.c b/epan/dissectors/packet-starteam.c
index 16fb5cca95..97e58cd5bb 100644
--- a/epan/dissectors/packet-starteam.c
+++ b/epan/dissectors/packet-starteam.c
@@ -499,18 +499,18 @@ dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
iPreviousFrameNumber = pinfo->fd->num;
- if(tvb_length(tvb) >= 16){
+ if(tvb_captured_length(tvb) >= 16){
guint32 iCommand = 0;
gboolean bRequest = FALSE;
if(tvb_get_ntohl(tvb, offset + 0) == STARTEAM_MAGIC){
/* This packet is a response */
bRequest = FALSE;
- col_append_fstr(pinfo->cinfo, COL_INFO, "Reply: %d bytes", tvb_length(tvb));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Reply: %d bytes", tvb_captured_length(tvb));
- } else if(tvb_length_remaining(tvb, offset) >= 28 && tvb_get_ntohl(tvb, offset + 20) == STARTEAM_MAGIC){
+ } else if(tvb_captured_length_remaining(tvb, offset) >= 28 && tvb_get_ntohl(tvb, offset + 20) == STARTEAM_MAGIC){
/* This packet is a request */
bRequest = TRUE;
- if(tvb_length_remaining(tvb, offset) >= 66){
+ if(tvb_captured_length_remaining(tvb, offset) >= 66){
iCommand = tvb_get_letohl(tvb, offset + 62);
}
col_append_str(pinfo->cinfo, COL_INFO,
@@ -528,7 +528,7 @@ dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
starteamroot_tree = proto_item_add_subtree(ti, ett_starteam);
if(bRequest){
- if(tvb_length_remaining(tvb, offset) >= 20){
+ if(tvb_captured_length_remaining(tvb, offset) >= 20){
ti = proto_tree_add_text(starteamroot_tree, tvb, offset, 20, STARTEAM_TEXT_MDH);
starteam_tree = proto_item_add_subtree(ti, ett_starteam_mdh);
@@ -541,7 +541,7 @@ dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
- if(tvb_length_remaining(tvb, offset) >= 16){
+ if(tvb_captured_length_remaining(tvb, offset) >= 16){
ti = proto_tree_add_text(starteamroot_tree, tvb, offset, 16, STARTEAM_TEXT_PH);
starteam_tree = proto_item_add_subtree(ti, ett_starteam_ph);
@@ -552,7 +552,7 @@ dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
offset += 16;
if(bRequest){
- if(tvb_length_remaining(tvb, offset) >= 38){
+ if(tvb_captured_length_remaining(tvb, offset) >= 38){
ti = proto_tree_add_text(starteamroot_tree, tvb, offset, 38, STARTEAM_TEXT_ID);
starteam_tree = proto_item_add_subtree(ti, ett_starteam_id);
@@ -566,26 +566,26 @@ dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
offset += 38;
}
}
- if(tvb_length_remaining(tvb, offset) > 0){
+ if(tvb_captured_length_remaining(tvb, offset) > 0){
ti = proto_tree_add_text(starteamroot_tree, tvb, offset, -1, STARTEAM_TEXT_DATA);
starteam_tree = proto_item_add_subtree(ti, ett_starteam_data);
- proto_tree_add_item(starteam_tree, hf_starteam_data_data, tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII|ENC_NA);
+ proto_tree_add_item(starteam_tree, hf_starteam_data_data, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII|ENC_NA);
}
}
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
get_starteam_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
guint32 iPDULength = 0;
- if(tvb_length_remaining(tvb, offset) >= 8 && tvb_get_ntohl(tvb, offset + 0) == STARTEAM_MAGIC){
+ if(tvb_captured_length_remaining(tvb, offset) >= 8 && tvb_get_ntohl(tvb, offset + 0) == STARTEAM_MAGIC){
/* Response */
iPDULength = tvb_get_letohl(tvb, offset + 4) + 16;
- } else if(tvb_length_remaining(tvb, offset) >= 28 && tvb_get_ntohl(tvb, offset + 20) == STARTEAM_MAGIC){
+ } else if(tvb_captured_length_remaining(tvb, offset) >= 28 && tvb_get_ntohl(tvb, offset + 20) == STARTEAM_MAGIC){
/* Request */
iPDULength = tvb_get_letohl(tvb, offset + 24) + 36;
}
@@ -596,14 +596,14 @@ static int
dissect_starteam_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, starteam_desegment, 8, get_starteam_pdu_len, dissect_starteam, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
dissect_starteam_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if(tvb_length(tvb) >= 32){
+ if(tvb_captured_length(tvb) >= 32){
gint iOffsetLengths = -1;
if(tvb_get_ntohl(tvb, 0) == STARTEAM_MAGIC){
iOffsetLengths = 4;
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 01b55e489e..6c794d0f68 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -1636,11 +1636,11 @@ dissect_v8_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tr
/* 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;
if (tree) {
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(tag, v8_parameter_tag_values, "Unknown parameter"));
+ parameter_item = proto_tree_add_text(tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s", val_to_str_const(tag, v8_parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_sua_parameter);
/* add tag and length to the sua tree */
@@ -1921,7 +1921,7 @@ 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;
if (tree) {
/* Create proto_tree stuff */
@@ -1931,12 +1931,12 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tree
param_tag_str = try_val_to_str(tag, parameter_tag_values);
if(param_tag_str) {
/* The parameter exists */
- parameter_item = proto_tree_add_text(tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", param_tag_str);
+ parameter_item = proto_tree_add_text(tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s", param_tag_str);
} else {
if(dissector_try_uint(sua_parameter_table, tag, parameter_tvb, pinfo,tree)) {
return;
} else {
- parameter_item = proto_tree_add_text(tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "Unknown parameter");
+ parameter_item = proto_tree_add_text(tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "Unknown parameter");
}
}
parameter_tree = proto_item_add_subtree(parameter_item, ett_sua_parameter);
@@ -2130,7 +2130,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-sv.c b/epan/dissectors/packet-sv.c
index 6fa8e87df3..6b04ce0fad 100644
--- a/epan/dissectors/packet-sv.c
+++ b/epan/dissectors/packet-sv.c
@@ -192,7 +192,7 @@ dissect_PhsMeas1(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tv
offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
} else {
- len=tvb_length_remaining(tvb, offset);
+ len=tvb_captured_length_remaining(tvb, offset);
}
if (tree) {
@@ -284,7 +284,7 @@ dissect_sv_UtcTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
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-sync.c b/epan/dissectors/packet-sync.c
index cfea027642..b4ecec6589 100644
--- a/epan/dissectors/packet-sync.c
+++ b/epan/dissectors/packet-sync.c
@@ -85,11 +85,11 @@ dissect_sync(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
if ( type > 3 )
return 0;
- if ( type == 0 && tvb_length(tvb) < 18) {
+ if ( type == 0 && tvb_captured_length(tvb) < 18) {
return 0;
- } else if ( type == 1 && tvb_length(tvb) < 11 ) {
+ } else if ( type == 1 && tvb_captured_length(tvb) < 11 ) {
return 0;
- } else if ( type == 3 && tvb_length(tvb) < 19 ) {
+ } else if ( type == 3 && tvb_captured_length(tvb) < 19 ) {
return 0;
}
@@ -219,7 +219,7 @@ dissect_sync(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-synergy.c b/epan/dissectors/packet-synergy.c
index 61de89c145..2921b67e66 100644
--- a/epan/dissectors/packet-synergy.c
+++ b/epan/dissectors/packet-synergy.c
@@ -221,7 +221,7 @@ static void dissect_synergy_handshake( tvbuff_t *tvb, packet_info *pinfo _U_, pr
proto_tree_add_item(sub_tree, hf_synergy_handshake_majorversion, tvb, offset + 7, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_synergy_handshake_minorversion, tvb, offset + 9, 2, ENC_BIG_ENDIAN);
- if (tvb_length_remaining(tvb, offset + 11) != 0)
+ if (tvb_captured_length_remaining(tvb, offset + 11) != 0)
{
proto_tree_add_item(sub_tree, hf_synergy_unknown, tvb, offset + 11, 4, ENC_NA);
proto_tree_add_item(sub_tree, hf_synergy_handshake_clientname, tvb, offset + 15, -1, ENC_ASCII|ENC_NA);
@@ -262,7 +262,7 @@ static void dissect_synergy_dkdn( tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
proto_tree_add_item(sub_tree, hf_synergy_dkdn_keyid, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_synergy_dkdn_keymodifiermask, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
- if (tvb_length_remaining(tvb, offset + 8) != 0)
+ if (tvb_captured_length_remaining(tvb, offset + 8) != 0)
proto_tree_add_item(sub_tree, hf_synergy_dkdn_keybutton, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
}
@@ -277,7 +277,7 @@ static void dissect_synergy_dkrp( tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
proto_tree_add_item(sub_tree, hf_synergy_dkrp_keymodifiermask, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_synergy_dkrp_numberofrepeats, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
- if (tvb_length_remaining(tvb, offset + 10) != 0)
+ if (tvb_captured_length_remaining(tvb, offset + 10) != 0)
proto_tree_add_item(sub_tree, hf_synergy_dkrp_keybutton, tvb, offset + 10, 2, ENC_BIG_ENDIAN);
}
@@ -291,7 +291,7 @@ static void dissect_synergy_dkup( tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
proto_tree_add_item(sub_tree, hf_synergy_dkup_keyid, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_synergy_dkup_keymodifiermask, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
- if (tvb_length_remaining(tvb, offset + 8) != 0)
+ if (tvb_captured_length_remaining(tvb, offset + 8) != 0)
proto_tree_add_item(sub_tree, hf_synergy_dkup_keybutton, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
}
diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c
index 5374844350..88f1abd46d 100644
--- a/epan/dissectors/packet-synphasor.c
+++ b/epan/dissectors/packet-synphasor.c
@@ -443,7 +443,7 @@ static int dissect_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
{
guint8 frame_type;
guint16 crc;
- guint tvbsize = tvb_length(tvb);
+ guint tvbsize = tvb_captured_length(tvb);
/* some heuristics */
if (tvbsize < 17 /* 17 bytes = header frame with only a
@@ -554,7 +554,7 @@ static int dissect_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
/*offset += 2;*/ /* CRC */
} /* if (tree) */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_synphasor() */
/* called for synchrophasors over UDP */
@@ -573,7 +573,7 @@ static int dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4, get_pdu_length, dissect_common, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -765,7 +765,7 @@ static int dissect_data_frame(tvbuff_t *tvb,
reported_size += BLOCKSIZE(*block);
}
- if (tvb_length(tvb) == reported_size) {
+ if (tvb_captured_length(tvb) == reported_size) {
proto_item_append_text(data_item, ", using frame number %"G_GUINT32_FORMAT" as configuration frame",
conf->fnum);
config_found = TRUE;
@@ -818,7 +818,7 @@ static int dissect_command_frame(tvbuff_t *tvb,
packet_info *pinfo)
{
proto_tree *command_tree = NULL;
- guint tvbsize = tvb_length(tvb);
+ guint tvbsize = tvb_captured_length(tvb);
const char *s;
proto_item_set_text(command_item, "Command data");
diff --git a/epan/dissectors/packet-sysex.c b/epan/dissectors/packet-sysex.c
index aef7b5de25..43f8b304c6 100644
--- a/epan/dissectors/packet-sysex.c
+++ b/epan/dissectors/packet-sysex.c
@@ -742,7 +742,7 @@ static tvbuff_t *
unpack_digitech_message(tvbuff_t *tvb, gint offset)
{
tvbuff_t *next_tvb;
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
gint data_len = length - offset - 2;
const guint8* data_ptr;
gint remaining = data_len;
@@ -977,7 +977,7 @@ dissect_digitech_procedure(guint8 procedure, const gint offset,
* of System Exclusive packet (one byte is checksum, the other one
* is EOX)
*/
- if (tvb_length(tvb) - offset < 2)
+ if (tvb_captured_length(tvb) - offset < 2)
{
/* There is no DigiTech procedure data, do not attempt further
* dissection */
@@ -988,7 +988,7 @@ dissect_digitech_procedure(guint8 procedure, const gint offset,
add_new_data_source(pinfo, data_tvb, "Unpacked Procedure Data");
data_offset = 0;
- data_len = tvb_length(data_tvb);
+ data_len = tvb_captured_length(data_tvb);
switch (procedure)
{
@@ -1120,7 +1120,7 @@ dissect_sysex_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SYSEX");
col_set_str(pinfo->cinfo, COL_INFO, "MIDI System Exclusive Command");
- data_len = tvb_length(tvb);
+ data_len = tvb_captured_length(tvb);
if (parent_tree)
{
@@ -1186,7 +1186,7 @@ dissect_sysex_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree
dissect_digitech_procedure(procedure_id, offset, tvb, pinfo, tree);
- len = tvb_length(tvb) - 2;
+ len = tvb_captured_length(tvb) - 2;
offset = len; /* Penultimate byte is checksum */
data_ptr = tvb_get_ptr(tvb, 1, len);
/* Calculate checksum */
diff --git a/epan/dissectors/packet-t124.c b/epan/dissectors/packet-t124.c
index 9c236866e7..b8bed68e3c 100644
--- a/epan/dissectors/packet-t124.c
+++ b/epan/dissectors/packet-t124.c
@@ -582,7 +582,7 @@ dissect_t124_T_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr
if(next_tvb) {
- ns = tvb_get_string_enc(NULL, t124NSIdentifier, 0, tvb_length(t124NSIdentifier), ENC_ASCII|ENC_NA);
+ ns = tvb_get_string_enc(NULL, t124NSIdentifier, 0, tvb_captured_length(t124NSIdentifier), ENC_ASCII|ENC_NA);
if(ns != NULL) {
dissector_try_string(t124_ns_dissector_table, ns, next_tvb, actx->pinfo, top_tree, NULL);
g_free(ns);
@@ -1515,7 +1515,7 @@ dissect_t124_T_connectPDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
/* Not sure why - but lets ignore the length. */
/* We assume the OCTET STRING is all of the remaining bytes */
- if(tvb_length(next_tvb) == 42) {
+ if(tvb_captured_length(next_tvb) == 42) {
/* this is perhaps a naive ... */
next_tvb = tvb_new_subset_remaining(tvb, (old_offset>>3)+1);
}
@@ -2941,13 +2941,13 @@ dissect_t124_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
col_set_str(pinfo->cinfo, COL_PROTOCOL, "T.124");
col_clear(pinfo->cinfo, COL_INFO);
- item = proto_tree_add_item(parent_tree, proto_t124, tvb, 0, tvb_length(tvb), ENC_NA);
+ item = proto_tree_add_item(parent_tree, proto_t124, tvb, 0, tvb_captured_length(tvb), ENC_NA);
tree = proto_item_add_subtree(item, ett_t124);
asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
dissect_t124_ConnectData(tvb, 0, &asn1_ctx, tree, hf_t124_ConnectData);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-t125.c b/epan/dissectors/packet-t125.c
index 1d91634019..2e017db939 100644
--- a/epan/dissectors/packet-t125.c
+++ b/epan/dissectors/packet-t125.c
@@ -403,7 +403,7 @@ dissect_t125(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
col_set_str(pinfo->cinfo, COL_PROTOCOL, "T.125");
col_clear(pinfo->cinfo, COL_INFO);
- item = proto_tree_add_item(parent_tree, proto_t125, tvb, 0, tvb_length(tvb), ENC_NA);
+ item = proto_tree_add_item(parent_tree, proto_t125, tvb, 0, tvb_captured_length(tvb), ENC_NA);
tree = proto_item_add_subtree(item, ett_t125);
get_ber_identifier(tvb, 0, &ber_class, &pc, &tag);
@@ -415,7 +415,7 @@ dissect_t125(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
dissect_DomainMCSPDU_PDU(tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
diff --git a/epan/dissectors/packet-t30.c b/epan/dissectors/packet-t30.c
index 0169ee6ade..49a0684739 100644
--- a/epan/dissectors/packet-t30.c
+++ b/epan/dissectors/packet-t30.c
@@ -962,7 +962,7 @@ dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
tr_fif = proto_item_add_subtree(it_fcf, ett_t30_fif);
- frag_len = tvb_length_remaining(tvb, offset);
+ frag_len = tvb_captured_length_remaining(tvb, offset);
if (t38)
t38->t30_Facsimile_Control = octet;
diff --git a/epan/dissectors/packet-t38.c b/epan/dissectors/packet-t38.c
index 07e81d9fcc..1b0c9bc4b7 100644
--- a/epan/dissectors/packet-t38.c
+++ b/epan/dissectors/packet-t38.c
@@ -680,7 +680,7 @@ dissect_t38_T_field_data(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
1, 65535, FALSE, &value_tvb);
- value_len = tvb_length(value_tvb);
+ value_len = tvb_captured_length(value_tvb);
@@ -1129,7 +1129,7 @@ dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_UDPTLPacket_PDU(tvb, pinfo, tr, NULL);
- if (tvb_length_remaining(tvb,offset)>0){
+ if (tvb_captured_length_remaining(tvb,offset)>0){
if (tr){
proto_tree_add_text(tr, tvb, offset, tvb_reported_length_remaining(tvb, offset),
"[MALFORMED PACKET or wrong preference settings]");
@@ -1168,13 +1168,13 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_str(pinfo->cinfo, COL_INFO, "TCP: IFPPacket");
- while(tvb_length_remaining(tvb,offset)>0)
+ while(tvb_captured_length_remaining(tvb,offset)>0)
{
next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_IFPPacket_PDU(next_tvb, pinfo, tr, NULL);
ifp_packet_number++;
- if(tvb_length_remaining(tvb,offset)>0){
+ if(tvb_captured_length_remaining(tvb,offset)>0){
if(t38_tpkt_usage == T38_TPKT_ALWAYS){
if(tr){
proto_tree_add_text(tr, tvb, offset, tvb_reported_length_remaining(tvb, offset),
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index e663c72997..9f5c0dd0b1 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -738,7 +738,7 @@ dissect_tacplus_body(tvbuff_t * hdr_tvb, tvbuff_t * tvb, proto_tree * tree )
dissect_tacplus_body_acct_rep( tvb, tree );
break;
default:
- proto_tree_add_text( tree, tvb, 0, tvb_length( tvb ), "Bogus..");
+ proto_tree_add_text( tree, tvb, 0, tvb_captured_length( tvb ), "Bogus..");
break;
}
}
@@ -888,7 +888,7 @@ dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
len = tvb_get_ntohl(tvb, 8);
- if(len > (guint)tvb_length_remaining(tvb, 12) &&
+ if(len > (guint)tvb_captured_length_remaining(tvb, 12) &&
pinfo->can_desegment && tacplus_preference_desegment) {
pinfo->desegment_offset = 0;
pinfo->desegment_len = len;
diff --git a/epan/dissectors/packet-tali.c b/epan/dissectors/packet-tali.c
index 390ed562aa..9479a7a602 100644
--- a/epan/dissectors/packet-tali.c
+++ b/epan/dissectors/packet-tali.c
@@ -135,7 +135,7 @@ dissect_tali_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -143,7 +143,7 @@ dissect_tali(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, tali_desegment, TALI_HEADER_LENGTH,
get_tali_pdu_len, dissect_tali_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
diff --git a/epan/dissectors/packet-tapa.c b/epan/dissectors/packet-tapa.c
index 49bc6e4845..2aa0c3745b 100644
--- a/epan/dissectors/packet-tapa.c
+++ b/epan/dissectors/packet-tapa.c
@@ -426,7 +426,7 @@ test_tapa_discover(tvbuff_t *tvb)
guint8 type, req_type;
guint16 length;
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return FALSE;
/* Type(1 byte) <= 5, unknown(1 byte), length(2 bytes) */
@@ -451,7 +451,7 @@ test_tapa_tunnel(tvbuff_t *tvb)
{
/* If it isn't IPv4, it's TAPA. IPv4: Version(1 byte) = 4,
length(2 bytes) >= 20 */
- if (tvb_length(tvb) < 4 ||
+ if (tvb_captured_length(tvb) < 4 ||
(tvb_get_guint8(tvb, 0) & 0xF0) >= 0x40 ||
tvb_get_ntohs(tvb, 2) > 0 ||
tvb_get_guint8(tvb, 1) > 1) { /* Is tunnel type known? */
diff --git a/epan/dissectors/packet-tcap.c b/epan/dissectors/packet-tcap.c
index 1f770dc171..f3143ea724 100644
--- a/epan/dissectors/packet-tcap.c
+++ b/epan/dissectors/packet-tcap.c
@@ -770,7 +770,7 @@ offset = dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_t
&parameter_tvb);
if (parameter_tvb){
- len = tvb_length_remaining(parameter_tvb, 0);
+ len = tvb_captured_length_remaining(parameter_tvb, 0);
switch(len) {
case 1:
gp_tcapsrt_info->src_tid=tvb_get_guint8(parameter_tvb, 0);
@@ -847,7 +847,7 @@ offset = dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_t
&parameter_tvb);
if (parameter_tvb){
- len = tvb_length_remaining(parameter_tvb, 0);
+ len = tvb_captured_length_remaining(parameter_tvb, 0);
switch(len) {
case 1:
gp_tcapsrt_info->dst_tid=tvb_get_guint8(parameter_tvb, 0);
diff --git a/epan/dissectors/packet-tdmoe.c b/epan/dissectors/packet-tdmoe.c
index 9559883a46..adc841eea9 100644
--- a/epan/dissectors/packet-tdmoe.c
+++ b/epan/dissectors/packet-tdmoe.c
@@ -69,7 +69,7 @@ dissect_tdmoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
int chan;
/* Check that there's enough data */
- if (tvb_length(tvb) < 8)
+ if (tvb_captured_length(tvb) < 8)
return 0;
subaddress = tvb_get_ntohs(tvb, 0);
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c
index 48e811fb4d..b438b18f7f 100644
--- a/epan/dissectors/packet-tds.c
+++ b/epan/dissectors/packet-tds.c
@@ -1406,7 +1406,7 @@ netlib_check_login_pkt(tvbuff_t *tvb, guint offset, packet_info *pinfo, guint8 t
{
guint tds_major, bytes_avail;
- bytes_avail = tvb_length(tvb) - offset;
+ bytes_avail = tvb_captured_length(tvb) - offset;
/*
* we have two login packet styles, one for TDS 4.2 and 5.0
*/
@@ -2110,7 +2110,7 @@ dissect_tds_rpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tree = proto_item_add_subtree(item, ett_tds_message);
dissect_tds_all_headers(tvb, &offset, pinfo, tree);
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
/*
* RPC name.
*/
@@ -2149,7 +2149,7 @@ dissect_tds_rpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
/* dissect parameters */
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
gboolean plp;
len = tvb_get_guint8(tvb, offset);
@@ -2603,7 +2603,7 @@ dissect_tds_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
* If we don't have even enough data for a Netlib header,
* just say it's not TDS.
*/
- if (tvb_length(tvb) < 8)
+ if (tvb_captured_length(tvb) < 8)
return FALSE;
/*
diff --git a/epan/dissectors/packet-teamspeak2.c b/epan/dissectors/packet-teamspeak2.c
index 0fd921ab3b..0afb734422 100644
--- a/epan/dissectors/packet-teamspeak2.c
+++ b/epan/dissectors/packet-teamspeak2.c
@@ -433,7 +433,7 @@ static void ts2_standard_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
frag_msg = NULL;
pinfo->fragmented = TRUE;
fragment_number = tvb_get_letohs(tvb, 18);
- frag_msg = fragment_add_seq_check(&msg_reassembly_table, tvb, 24, pinfo, type, NULL, frag->frag_num, tvb_length_remaining(tvb, 24), fragment_number);
+ frag_msg = fragment_add_seq_check(&msg_reassembly_table, tvb, 24, pinfo, type, NULL, frag->frag_num, tvb_captured_length_remaining(tvb, 24), fragment_number);
new_tvb = process_reassembled_data(tvb, 24, pinfo,"Reassembled TeamSpeak2", frag_msg, &msg_frag_items, NULL, ts2_tree);
if (frag_msg) /* XXX: should be if (new_tvb) ?? */
{ /* Reassembled */
@@ -517,7 +517,7 @@ static void ts2_parse_loginend(tvbuff_t *tvb, proto_tree *ts2_tree)
{
gint32 offset;
offset=0;
- proto_tree_add_item(ts2_tree, hf_ts2_unknown, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
+ proto_tree_add_item(ts2_tree, hf_ts2_unknown, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
}
/* Parses a ts2 known player joined (TS2_KNOWNPLAYERUPDATE) packet and adds it to the tree */
@@ -577,7 +577,7 @@ static void ts2_parse_playerleft(tvbuff_t *tvb, proto_tree *ts2_tree)
offset+=4;
proto_tree_add_item(ts2_tree, hf_ts2_unknown, tvb, offset, 4, ENC_NA);
offset+=4;
- proto_tree_add_item(ts2_tree, hf_ts2_unknown, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
+ proto_tree_add_item(ts2_tree, hf_ts2_unknown, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
}
/* Parses a ts2 login part 2 (TS2T_LOGINPART2) packet and adds it to the tree */
@@ -607,7 +607,7 @@ static void ts2_parse_channellist(tvbuff_t *tvb, proto_tree *ts2_tree)
offset=0;
proto_tree_add_item(ts2_tree, hf_ts2_number_of_channels, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
- while(offset<tvb_length_remaining(tvb, 0))
+ while(offset<tvb_captured_length_remaining(tvb, 0))
{
proto_tree_add_item(ts2_tree, hf_ts2_channel_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
@@ -665,7 +665,7 @@ static void ts2_parse_playerlist(tvbuff_t *tvb, proto_tree *ts2_tree)
proto_tree_add_item(ts2_tree, hf_ts2_number_of_players, tvb, offset, 4, ENC_LITTLE_ENDIAN);
number_of_players = tvb_get_letohl(tvb, 0);
offset+=4;
- while(offset<tvb_length_remaining(tvb, 0) && x<number_of_players)
+ while(offset<tvb_captured_length_remaining(tvb, 0) && x<number_of_players)
{
proto_tree_add_item(ts2_tree, hf_ts2_player_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
@@ -680,7 +680,7 @@ static void ts2_parse_playerlist(tvbuff_t *tvb, proto_tree *ts2_tree)
offset+=30;
x++;
}
- proto_tree_add_item(ts2_tree, hf_ts2_emptyspace, tvb, offset, tvb_length_remaining(tvb, 0), ENC_NA);
+ proto_tree_add_item(ts2_tree, hf_ts2_emptyspace, tvb, offset, tvb_captured_length_remaining(tvb, 0), ENC_NA);
}
diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c
index 8274beff16..4eff6ddb7d 100644
--- a/epan/dissectors/packet-telnet.c
+++ b/epan/dissectors/packet-telnet.c
@@ -1545,7 +1545,7 @@ telnet_sub_option(packet_info *pinfo, proto_tree *option_tree, proto_item *optio
/* Search for an unescaped IAC. */
cur_offset = offset;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
do {
iac_offset = tvb_find_guint8(tvb, cur_offset, len, TN_IAC);
iac_found = TRUE;
@@ -1775,7 +1775,7 @@ static int find_unescaped_iac(tvbuff_t *tvb, int offset, int len)
(tvb_get_guint8(tvb, iac_offset + 1) == TN_IAC))
{
iac_offset+=2;
- len = tvb_length_remaining(tvb, iac_offset);
+ len = tvb_captured_length_remaining(tvb, iac_offset);
}
return iac_offset;
}
@@ -1804,7 +1804,7 @@ dissect_telnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Scan through the buffer looking for an IAC byte.
*/
- while ((len = tvb_length_remaining(tvb, offset)) > 0) {
+ while ((len = tvb_captured_length_remaining(tvb, offset)) > 0) {
iac_offset = find_unescaped_iac(tvb, offset, len);
if (iac_offset != -1) {
/*
diff --git a/epan/dissectors/packet-teredo.c b/epan/dissectors/packet-teredo.c
index 1ae394d8c9..ff398c172e 100644
--- a/epan/dissectors/packet-teredo.c
+++ b/epan/dissectors/packet-teredo.c
@@ -265,7 +265,7 @@ dissect_teredo_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
if (!global_teredo_heur)
return FALSE;
- if (tvb_length_remaining(tvb, offset) < 40)
+ if (tvb_captured_length_remaining(tvb, offset) < 40)
return FALSE;
val = tvb_get_ntohs(tvb, offset);
@@ -282,7 +282,7 @@ dissect_teredo_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
aulen = tvb_get_guint8(tvb, offset);
offset += 10;
- if (tvb_length_remaining(tvb, offset) < idlen + aulen + 40)
+ if (tvb_captured_length_remaining(tvb, offset) < idlen + aulen + 40)
return FALSE;
offset += idlen + aulen;
@@ -294,7 +294,7 @@ dissect_teredo_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
{
offset += 8;
- if (tvb_length_remaining(tvb, offset) < 40)
+ if (tvb_captured_length_remaining(tvb, offset) < 40)
return FALSE;
val = tvb_get_ntohs(tvb, offset);
@@ -316,7 +316,7 @@ dissect_teredo_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
if (val > 65467)
return FALSE; /* length too big for Teredo */
- if (tvb_length_remaining(tvb, offset) != val)
+ if (tvb_captured_length_remaining(tvb, offset) != val)
return FALSE; /* length mismatch */
dissect_teredo (tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-tetra.c b/epan/dissectors/packet-tetra.c
index c576307a0a..3b740d7107 100644
--- a/epan/dissectors/packet-tetra.c
+++ b/epan/dissectors/packet-tetra.c
@@ -8907,7 +8907,7 @@ void tetra_dissect_pdu(int channel_type, int dir, tvbuff_t *pdu, proto_tree *tre
guint8 p;
tetra_sub_item = proto_tree_add_item(tree, hf_tetra_pdu,
- pdu, 0, tvb_length(pdu), ENC_NA);
+ pdu, 0, tvb_captured_length(pdu), ENC_NA);
tetra_sub_tree = proto_item_add_subtree(tetra_sub_item, ett_tetra);
diff --git a/epan/dissectors/packet-text-media.c b/epan/dissectors/packet-text-media.c
index 824d5d1119..a1069c4c65 100644
--- a/epan/dissectors/packet-text-media.c
+++ b/epan/dissectors/packet-text-media.c
@@ -62,7 +62,7 @@ dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
gint offset = 0, next_offset;
gint len;
const char *data_name;
- int length = tvb_length(tvb);
+ int length = tvb_captured_length(tvb);
/* Check if this is actually xml
* If there is less than 38 characters this is not XML
@@ -71,7 +71,7 @@ dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
if(length > 38){
if (tvb_strncaseeql(tvb, 0, "<?xml", 5) == 0){
call_dissector(xml_handle, tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
@@ -131,7 +131,7 @@ dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c
index d542823532..61958e2fbf 100644
--- a/epan/dissectors/packet-tipc.c
+++ b/epan/dissectors/packet-tipc.c
@@ -1047,7 +1047,7 @@ dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, proto_tree *tipc_tree, packet_i
offset += padlen;
};
if ((offset-msg_size) > 0) {
- proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1, "Filler for MTU discovery: %d byte%c", tvb_length_remaining(tipc_tvb, offset), (padlen!=1?'s':0));
+ proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1, "Filler for MTU discovery: %d byte%c", tvb_captured_length_remaining(tipc_tvb, offset), (padlen!=1?'s':0));
};
break;
case TIPCv2_CONN_MANAGER:
@@ -1938,7 +1938,7 @@ dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tr
pinfo,
link_sel, /* ID for fragments belonging together - NEEDS IMPROVING? */
NULL,
- tvb_length_remaining(tvb, offset), /* fragment length - to the end */
+ tvb_captured_length_remaining(tvb, offset), /* fragment length - to the end */
TRUE); /* More fragments? */
if (msg_type == TIPC_FIRST_SEGMENT) {
reassembled_msg_length = tvb_get_ntohl(tvb, offset) & 0x1ffff;
@@ -2017,7 +2017,7 @@ dissect_tipc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
{
tcp_dissect_pdus(tvb, pinfo, parent_tree, tipc_tcp_desegment, 4, get_tipc_pdu_len,
dissect_tipc, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -2049,7 +2049,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
user = (dword>>25) & 0xf;
msg_size = dword & 0x1ffff;
- if ((guint32)tvb_length_remaining(tvb, offset) < msg_size) {
+ if ((guint32)tvb_captured_length_remaining(tvb, offset) < msg_size) {
tipc_tvb = tvb;
} else {
tipc_tvb = tvb_new_subset_length(tvb, offset, msg_size);
@@ -2148,7 +2148,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
tipc_tree = proto_item_add_subtree(ti, ett_tipc);
if (version == TIPCv2) {
dissect_tipc_v2(tipc_tvb, tipc_tree, pinfo, offset, user, msg_size, hdr_size, datatype_hdr);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Word 0-2 common for all messages */
@@ -2185,7 +2185,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
case TIPC_SEGMENTATION_MANAGER:
case TIPC_MSG_BUNDLER:
dissect_tipc_int_prot_msg(tipc_tvb, pinfo, tipc_tree, offset, user, msg_size);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
default:
break;
}
@@ -2263,7 +2263,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
tipc_data_tree = proto_item_add_subtree(tipc_data_item , ett_tipc_data);
data_tvb = tvb_new_subset_remaining(tipc_tvb, offset);
dissect_tipc_name_dist_data(data_tvb, tipc_data_tree, 0);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} else {
/* Port name type / Connection level sequence number */
proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4, "Port name type / Connection level sequence number");
@@ -2300,7 +2300,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
} /*if (hdr_size <= 5) */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register TIPC with Wireshark */
diff --git a/epan/dissectors/packet-tivoconnect.c b/epan/dissectors/packet-tivoconnect.c
index c55fa14556..eb85dcac65 100644
--- a/epan/dissectors/packet-tivoconnect.c
+++ b/epan/dissectors/packet-tivoconnect.c
@@ -77,7 +77,7 @@ dissect_tivoconnect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
return 0;
}
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
string = (gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, 0, length, ENC_ASCII);
/* Make entries in Protocol column and Info column on summary display */
@@ -184,7 +184,7 @@ dissect_tivoconnect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
/* If this protocol has a sub-dissector call it here, see section 1.8 */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
diff --git a/epan/dissectors/packet-tns.c b/epan/dissectors/packet-tns.c
index 82967fd433..f94e36d71a 100644
--- a/epan/dissectors/packet-tns.c
+++ b/epan/dissectors/packet-tns.c
@@ -861,7 +861,7 @@ dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
tcp_dissect_pdus(tvb, pinfo, tree, tns_desegment, 2,
get_tns_pdu_len, dissect_tns_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -972,7 +972,7 @@ dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_register_tns(void)
diff --git a/epan/dissectors/packet-tpkt.c b/epan/dissectors/packet-tpkt.c
index a820aa81ad..f93670fe0c 100644
--- a/epan/dissectors/packet-tpkt.c
+++ b/epan/dissectors/packet-tpkt.c
@@ -83,7 +83,7 @@ is_tpkt(tvbuff_t *tvb, int min_len)
return -1;
/* There should at least be 4 bytes left in the frame */
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return -1; /* there aren't */
/*
@@ -261,7 +261,7 @@ dissect_asciitpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return;
}
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
/*
* Get the length from the TPKT header.
@@ -416,7 +416,7 @@ dissect_tpkt_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return;
}
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
/*
* Can we do reassembly?
diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c
index f75cbf6a50..a1c8f34ccb 100644
--- a/epan/dissectors/packet-tpncp.c
+++ b/epan/dissectors/packet-tpncp.c
@@ -155,7 +155,7 @@ static void dissect_tpncp_data(gint data_id, tvbuff_t *tvb, proto_item *item,
case 1: case 2: case 3: case 4:
case 5: case 6: case 7: case 8:
if ((g_str_len = current_tpncp_data_field_info->tpncp_data_field_array_dim)) { /* add char array */
- g_str_len = MIN(g_str_len, tvb_length_remaining(tvb, *offset));
+ g_str_len = MIN(g_str_len, tvb_captured_length_remaining(tvb, *offset));
proto_tree_add_item(ltree, current_tpncp_data_field_info->tpncp_data_field_descr,
tvb, *offset, g_str_len, ENC_NA|ENC_ASCII);
(*offset) += g_str_len;
@@ -220,7 +220,7 @@ static void dissect_tpncp_data(gint data_id, tvbuff_t *tvb, proto_item *item,
break;
}
current_tpncp_data_field_info = current_tpncp_data_field_info->p_next;
- if (tvb_length_remaining(tvb, *offset) <= 0) {
+ if (tvb_captured_length_remaining(tvb, *offset) <= 0) {
break;
}
}
@@ -319,7 +319,7 @@ static int dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*-------------------------------------------------------------------------------------------------------------------------------------------*/
@@ -345,7 +345,7 @@ static int dissect_tpncp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Otherwise use the regular dissector (might not give correct dissection). */
dissect_tpncp(tvb, pinfo, tree, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*-------------------------------------------------------------------------------------------------------------------------------------------*/
diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c
index 172b30af2c..260bc878e9 100644
--- a/epan/dissectors/packet-tr.c
+++ b/epan/dissectors/packet-tr.c
@@ -156,7 +156,7 @@ int check_for_old_linux_tvb(tvbuff_t *tvb)
int x, bytes;
/* Restrict our looping to the boundaries of the frame */
- bytes = tvb_length(tvb);
+ bytes = tvb_captured_length(tvb);
if (bytes > 19) {
bytes = 19;
}
diff --git a/epan/dissectors/packet-trill.c b/epan/dissectors/packet-trill.c
index 25e90331c2..49bcaefbb9 100644
--- a/epan/dissectors/packet-trill.c
+++ b/epan/dissectors/packet-trill.c
@@ -142,7 +142,7 @@ dissect_trill( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
next_tvb = tvb_new_subset_remaining( tvb, TRILL_MIN_FRAME_LENGTH + op_len ) ;
call_dissector( eth_dissector, next_tvb, pinfo, tree ) ;
- return tvb_length( tvb ) ;
+ return tvb_captured_length( tvb ) ;
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-tte-pcf.c b/epan/dissectors/packet-tte-pcf.c
index 97be592f4c..556d35bacc 100644
--- a/epan/dissectors/packet-tte-pcf.c
+++ b/epan/dissectors/packet-tte-pcf.c
@@ -76,7 +76,7 @@ dissect_tte_pcf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 sync_domain = 0;
/* Check that there's enough data */
- if (tvb_length(tvb) < TTE_PCF_LENGTH )
+ if (tvb_captured_length(tvb) < TTE_PCF_LENGTH )
{
return;
}
diff --git a/epan/dissectors/packet-tte.c b/epan/dissectors/packet-tte.c
index 0b82d88499..76f16c36e1 100644
--- a/epan/dissectors/packet-tte.c
+++ b/epan/dissectors/packet-tte.c
@@ -72,7 +72,7 @@ dissect_tte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
proto_tree *tte_tree, *tte_macdest_tree;
/* Check that there's enough data */
- if (tvb_length(tvb) < TTE_HEADER_LENGTH)
+ if (tvb_captured_length(tvb) < TTE_HEADER_LENGTH)
return 0;
/* check if data of pcf frame */
@@ -132,7 +132,7 @@ dissect_tte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
ethertype_data.fcs_len = 0;
call_dissector_with_data(ethertype_handle, tvb, pinfo, tree, &ethertype_data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-turbocell.c b/epan/dissectors/packet-turbocell.c
index 8fd0947652..64aba74e06 100644
--- a/epan/dissectors/packet-turbocell.c
+++ b/epan/dissectors/packet-turbocell.c
@@ -168,7 +168,7 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
}
- remaining_length=tvb_length_remaining(tvb, 0x14);
+ remaining_length=tvb_captured_length_remaining(tvb, 0x14);
if (remaining_length > 6) {
@@ -183,7 +183,7 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
str_name=tvb_get_stringz_enc(wmem_packet_scope(), tvb, 0x14, &str_len, ENC_ASCII);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Network=\"%s\"",format_text(str_name, str_len-1));
- while(tvb_get_guint8(tvb, 0x34 + 8*i)==0x00 && (tvb_length_remaining(tvb,0x34 + 8*i) > 6) && (i<32)) {
+ while(tvb_get_guint8(tvb, 0x34 + 8*i)==0x00 && (tvb_captured_length_remaining(tvb,0x34 + 8*i) > 6) && (i<32)) {
proto_tree_add_item(network_tree, hf_turbocell_station[i], tvb, 0x34+8*i, 6, ENC_NA);
i++;
}
@@ -211,7 +211,7 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree_add_item(mpdu_tree, hf_turbocell_aggregate_len, next_tvb, 0x00, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(mpdu_tree, hf_turbocell_aggregate_unknown1, next_tvb, 0x02, 2, ENC_BIG_ENDIAN);
- remaining_length=tvb_length_remaining(next_tvb, msdu_offset);
+ remaining_length=tvb_captured_length_remaining(next_tvb, msdu_offset);
do {
msdu_length = (tvb_get_letohs(next_tvb, msdu_offset) & 0x0FFF);
diff --git a/epan/dissectors/packet-turnchannel.c b/epan/dissectors/packet-turnchannel.c
index c9637af694..fd683516a9 100644
--- a/epan/dissectors/packet-turnchannel.c
+++ b/epan/dissectors/packet-turnchannel.c
@@ -68,7 +68,7 @@ dissect_turnchannel_message(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *turnchannel_tree;
heur_dtbl_entry_t *hdtbl_entry;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/* First, make sure we have enough data to do the check. */
if (len < TURNCHANNEL_HDR_LEN) {
return 0;
@@ -102,7 +102,7 @@ dissect_turnchannel_message(tvbuff_t *tvb, packet_info *pinfo,
tvbuff_t *next_tvb;
guint reported_len, new_len;
- new_len = tvb_length_remaining(tvb, TURNCHANNEL_HDR_LEN);
+ new_len = tvb_captured_length_remaining(tvb, TURNCHANNEL_HDR_LEN);
reported_len = tvb_reported_length_remaining(tvb,
TURNCHANNEL_HDR_LEN);
if (data_len < reported_len) {
@@ -118,7 +118,7 @@ dissect_turnchannel_message(tvbuff_t *tvb, packet_info *pinfo,
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -132,7 +132,7 @@ dissect_turnchannel_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, TURNCHANNEL_HDR_LEN,
get_turnchannel_message_len, dissect_turnchannel_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -143,7 +143,7 @@ dissect_turnchannel_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
guint16 channel_id;
guint16 data_len;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/* First, make sure we have enough data to do the check. */
if (len < TURNCHANNEL_HDR_LEN) {
return FALSE;
diff --git a/epan/dissectors/packet-tuxedo.c b/epan/dissectors/packet-tuxedo.c
index fdf6be0604..9e04242e76 100644
--- a/epan/dissectors/packet-tuxedo.c
+++ b/epan/dissectors/packet-tuxedo.c
@@ -109,7 +109,7 @@ dissect_tuxedo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TUXEDO");
- if (tvb_length(tvb) >= 8)
+ if (tvb_captured_length(tvb) >= 8)
{
magic = tvb_get_ntohl(tvb, 0);
if (magic == TUXEDO_MAGIC || magic == TUXEDO_SMAGIC)
@@ -142,7 +142,7 @@ dissect_tuxedo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static gboolean
dissect_tuxedo_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- if (tvb_length(tvb) >= 8)
+ if (tvb_captured_length(tvb) >= 8)
{
guint32 magic;
magic = tvb_get_ntohl(tvb, 0);
diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c
index 16e57be868..d2915bd207 100644
--- a/epan/dissectors/packet-ua3g.c
+++ b/epan/dissectors/packet-ua3g.c
@@ -4067,7 +4067,7 @@ dissect_ua3g(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-uasip.c b/epan/dissectors/packet-uasip.c
index 5f82654a1d..cf9a65fad3 100644
--- a/epan/dissectors/packet-uasip.c
+++ b/epan/dissectors/packet-uasip.c
@@ -210,7 +210,7 @@ static void _dissect_uasip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
ua_tap_info.expseq = tvb_get_ntohs(tvb, offset+0);
ua_tap_info.sntseq = tvb_get_ntohs(tvb, offset+2);
offset += 4;
- datalen = (tvb_length(tvb) - offset);
+ datalen = (tvb_captured_length(tvb) - offset);
if (noesip_enabled)
{
diff --git a/epan/dissectors/packet-ubertooth.c b/epan/dissectors/packet-ubertooth.c
index 4ac66a3d62..74866e9707 100644
--- a/epan/dissectors/packet-ubertooth.c
+++ b/epan/dissectors/packet-ubertooth.c
@@ -1250,9 +1250,9 @@ dissect_usb_rx_packet(proto_tree *main_tree, proto_tree *tree, packet_info *pinf
call_dissector(btle_handle, next_tvb, pinfo, main_tree);
offset += length;
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(data_tree, hf_reserved, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1558,9 +1558,9 @@ dissect_ubertooth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
break;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
- proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset = tvb_length(tvb);
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
+ proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset = tvb_captured_length(tvb);
}
/* Save request info (command_data) */
@@ -1602,11 +1602,11 @@ dissect_ubertooth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
if (!command_data) {
col_append_str(pinfo->cinfo, COL_INFO, "Response: Unknown");
- proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset));
+ proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
pinfo->p2p_dir = p2p_dir_save;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "Response: %s",
@@ -1621,7 +1621,7 @@ dissect_ubertooth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
case 27: /* Spectrum Analyzer */
if (usb_conv_info->transfer_type == URB_BULK) {
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_usb_rx_packet(tree, main_tree, pinfo, tvb, offset, command_response);
}
break;
@@ -1660,9 +1660,9 @@ dissect_ubertooth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
case 54: /* BTLE Slave */
case 56: /* BTLE Set Target */
proto_tree_add_expert(command_tree, pinfo, &ei_unexpected_response, tvb, offset, 0);
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, -1);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
break;
case 3: /* Get User LED */
@@ -1818,7 +1818,7 @@ dissect_ubertooth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
break;
case 49: /* Poll */
- if (tvb_length_remaining(tvb, offset) == 1) {
+ if (tvb_captured_length_remaining(tvb, offset) == 1) {
proto_tree_add_item(main_tree, hf_reserved, tvb, offset, 1, ENC_NA);
offset += 1;
break;
@@ -1856,9 +1856,9 @@ dissect_ubertooth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
break;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, -1);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
pinfo->p2p_dir = p2p_dir_save;
diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c
index 38c8a7401e..0bf3916412 100644
--- a/epan/dissectors/packet-ucp.c
+++ b/epan/dissectors/packet-ucp.c
@@ -808,7 +808,7 @@ ucp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
idx = tvb_find_guint8(tvb, *offset, -1, '/');
if (idx == -1) {
/* Force the appropriate exception to be thrown. */
- len = tvb_length_remaining(tvb, *offset);
+ len = tvb_captured_length_remaining(tvb, *offset);
tvb_ensure_bytes_exist(tvb, *offset, len + 1);
} else
len = idx - *offset;
@@ -892,7 +892,7 @@ ucp_handle_int(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
idx = tvb_find_guint8(tvb, *offset, -1, '/');
if (idx == -1) {
/* Force the appropriate exception to be thrown. */
- len = tvb_length_remaining(tvb, *offset);
+ len = tvb_captured_length_remaining(tvb, *offset);
tvb_ensure_bytes_exist(tvb, *offset, len + 1);
} else
len = idx - *offset;
@@ -918,7 +918,7 @@ ucp_handle_time(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
idx = tvb_find_guint8(tvb, *offset, -1, '/');
if (idx == -1) {
/* Force the appropriate exception to be thrown. */
- len = tvb_length_remaining(tvb, *offset);
+ len = tvb_captured_length_remaining(tvb, *offset);
tvb_ensure_bytes_exist(tvb, *offset, len + 1);
} else
len = idx - *offset;
@@ -1781,7 +1781,7 @@ dissect_ucp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
if (tvb_get_guint8(tvb, 0) != UCP_STX){
proto_tree_add_text(tree, tvb, 0, -1,"UCP_STX missing, this is not a new packet");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Get data needed for dissect_ucp_common */
@@ -1949,7 +1949,7 @@ dissect_ucp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
/* Queue packet for Tap */
tap_queue_packet(ucp_tap, pinfo, tap_rec);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1957,7 +1957,7 @@ dissect_ucp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, ucp_desegment, UCP_HEADER_SIZE,
get_ucp_pdu_len, dissect_ucp_common, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -1971,7 +1971,7 @@ dissect_ucp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
/* Heuristic */
- if (tvb_length(tvb) < UCP_HEADER_SIZE)
+ if (tvb_captured_length(tvb) < UCP_HEADER_SIZE)
return FALSE;
if ((tvb_get_guint8(tvb, 0) != UCP_STX) ||
diff --git a/epan/dissectors/packet-ulp.c b/epan/dissectors/packet-ulp.c
index 78fbde00dc..048e5ba52e 100644
--- a/epan/dissectors/packet-ulp.c
+++ b/epan/dissectors/packet-ulp.c
@@ -6297,7 +6297,7 @@ dissect_ulp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, ulp_desegment, ULP_HEADER_SIZE,
get_ulp_pdu_len, dissect_ULP_PDU_PDU, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_reg_handoff_ulp(void);
diff --git a/epan/dissectors/packet-uma.c b/epan/dissectors/packet-uma.c
index 75fc509568..52a6a2ee12 100644
--- a/epan/dissectors/packet-uma.c
+++ b/epan/dissectors/packet-uma.c
@@ -1641,7 +1641,7 @@ dissect_uma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
proto_tree_add_item(uma_tree, hf_uma_skip_ind, tvb, offset, 1, ENC_BIG_ENDIAN);
if ((octet & 0xf0) != 0 ){
proto_tree_add_text(uma_tree, tvb,offset,-1,"Skip this message");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
proto_tree_add_item(uma_tree, hf_uma_pd, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1676,7 +1676,7 @@ dissect_uma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -1691,7 +1691,7 @@ dissect_uma_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, uma_desegment, UMA_HEADER_SIZE,
get_uma_pdu_len, dissect_uma, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1717,7 +1717,7 @@ dissect_uma_urlc_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
proto_tree_add_item(uma_tree, hf_uma_urlc_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str_ext(octet, &uma_urlc_msg_type_vals_ext, "Unknown URLC (%u)"));
col_set_fence(pinfo->cinfo,COL_INFO);
- msg_len = tvb_length_remaining(tvb,offset) - 1;
+ msg_len = tvb_captured_length_remaining(tvb,offset) - 1;
switch ( octet ){
@@ -1736,7 +1736,7 @@ dissect_uma_urlc_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
return offset;
default:
proto_tree_add_text(uma_tree, tvb,offset,-1,"Wrong message type %u",octet);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c
index 49b41a06b6..fa9575152c 100644
--- a/epan/dissectors/packet-umts_fp.c
+++ b/epan/dissectors/packet-umts_fp.c
@@ -622,11 +622,11 @@ static gboolean verify_control_frame_crc(tvbuff_t * tvb, packet_info * pinfo, pr
guint8 crc = 0;
guint8 * data = NULL;
/* Get data. */
- data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
+ data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_captured_length(tvb));
/* Include only FT flag bit in CRC calculation. */
data[0] = data[0] & 1;
/* Calculate crc7 sum. */
- crc = crc7update(0, data, tvb_length(tvb));
+ crc = crc7update(0, data, tvb_captured_length(tvb));
crc = crc7finalize(crc); /* finalize crc */
if (frame_crc == crc) {
proto_item_append_text(pi, " [correct]");
@@ -988,7 +988,7 @@ dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo,
int offset,guint header_length)
{
int crc_size = 0;
- int remain = tvb_length_remaining(tvb, offset);
+ int remain = tvb_captured_length_remaining(tvb, offset);
/* Payload CRC (optional) */
if ((dch_crc_present == 1) || ((dch_crc_present == 2) && (remain >= 2))) {
@@ -1532,7 +1532,7 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Info introduced in R6 */
/* only check if it looks as if they are present */
if (((p_fp_info->release == 6) || (p_fp_info->release == 7)) &&
- (tvb_length_remaining(tvb, offset) > 2))
+ (tvb_captured_length_remaining(tvb, offset) > 2))
{
int n;
guint8 flags;
@@ -1756,7 +1756,7 @@ dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* New IE flags (if it looks as though they are present) */
if ((p_fp_info->release == 7) &&
- (tvb_length_remaining(tvb, offset) > 2)) {
+ (tvb_captured_length_remaining(tvb, offset) > 2)) {
guint8 flags = tvb_get_guint8(tvb, offset);
guint8 aoa_present = flags & 0x01;
@@ -1918,7 +1918,7 @@ dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* New IEs */
if ((p_fp_info->release == 7) &&
- (tvb_length_remaining(tvb, offset) > 2)) {
+ (tvb_captured_length_remaining(tvb, offset) > 2)) {
guint8 flags = tvb_get_guint8(tvb, offset);
guint8 bits_extended = flags & 0x01;
@@ -2169,7 +2169,7 @@ dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
/* May be extended in R7, but in this case there are at least 2 bytes remaining */
if ((p_fp_info->release == 7) &&
- (tvb_length_remaining(tvb, offset) >= 2)) {
+ (tvb_captured_length_remaining(tvb, offset) >= 2)) {
/* New IE flags */
guint64 extended_bits_present;
@@ -2364,7 +2364,7 @@ dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo,
offset++;
if ((p_fp_info->release == 7) &&
- (tvb_length_remaining(tvb, offset) > 0)) {
+ (tvb_captured_length_remaining(tvb, offset) > 0)) {
/* New IE flags */
guint8 flags = tvb_get_guint8(tvb, offset);
@@ -3214,7 +3214,7 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Extra IEs (if there is room for them) */
if (((p_fp_info->release == 6) ||
(p_fp_info->release == 7)) &&
- (tvb_length_remaining(tvb, offset) > 2)) {
+ (tvb_captured_length_remaining(tvb, offset) > 2)) {
int n;
guint8 flags;
@@ -3781,7 +3781,7 @@ heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
* i.e. from bit 0 of the first byte of the header (the FT IE) to bit 0 of the last byte of the payload,
* with the corresponding generator polynomial: G(D) = D7+D6+D2+1. See subclause 7.2.
*/
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
buf = (unsigned char *)tvb_memdup(wmem_packet_scope(), tvb, 0, length);
buf[0] = 01;
diff --git a/epan/dissectors/packet-umts_mac.c b/epan/dissectors/packet-umts_mac.c
index cc609d289f..d6e552f752 100644
--- a/epan/dissectors/packet-umts_mac.c
+++ b/epan/dissectors/packet-umts_mac.c
@@ -463,7 +463,7 @@ static void dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
PROTO_ITEM_SET_GENERATED(channel_type);
/*We need to skip the first two bits (the TCTF bits), and since there is no MAC header, send rest to RRC*/
- next_tvb= tvb_new_octet_aligned(tvb, 2, (tvb_length(tvb)*8)-2);
+ next_tvb= tvb_new_octet_aligned(tvb, 2, (tvb_captured_length(tvb)*8)-2);
add_new_data_source(pinfo, next_tvb, "Octet-Aligned BCCH Data");
/* In this case skip RLC and call RRC immediately subdissector */
diff --git a/epan/dissectors/packet-usb-audio.c b/epan/dissectors/packet-usb-audio.c
index ea8f788910..e19c9e41aa 100644
--- a/epan/dissectors/packet-usb-audio.c
+++ b/epan/dissectors/packet-usb-audio.c
@@ -139,7 +139,7 @@ static gboolean
is_last_sysex_packet_in_tvb(tvbuff_t *tvb, gint offset)
{
gboolean last = TRUE;
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
offset += 4;
while (offset < length)
@@ -282,7 +282,7 @@ dissect_usb_audio_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tre
usb_conv_info_t *usb_conv_info;
proto_tree *tree = NULL;
guint offset;
- guint length = tvb_length(tvb);
+ guint length = tvb_captured_length(tvb);
/* Reject the packet if data is NULL */
@@ -317,7 +317,7 @@ dissect_usb_audio_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tre
proto_tree_add_expert(tree, pinfo, &ei_usb_audio_undecoded, tvb, offset, length - offset);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-usb-ccid.c b/epan/dissectors/packet-usb-ccid.c
index 1d4de957fe..f57801cfbd 100644
--- a/epan/dissectors/packet-usb-ccid.c
+++ b/epan/dissectors/packet-usb-ccid.c
@@ -509,7 +509,7 @@ dissect_ccid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
/* TODO: Try use "offset" instead of hardcoded constants */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-usb-dfu.c b/epan/dissectors/packet-usb-dfu.c
index ba3d5bd86b..aab3f1cc1b 100644
--- a/epan/dissectors/packet-usb-dfu.c
+++ b/epan/dissectors/packet-usb-dfu.c
@@ -290,12 +290,12 @@ dissect_usb_dfu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (command == 0x01) { /* Download */
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
- if (tvb_length_remaining(tvb, offset) > 0) {
- proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset = tvb_length(tvb);
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
+ proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset = tvb_captured_length(tvb);
}
/* Save request info (command_data) */
@@ -338,11 +338,11 @@ dissect_usb_dfu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (!command_data) {
col_append_str(pinfo->cinfo, COL_INFO, "Response: Unknown");
- proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset));
+ proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
pinfo->p2p_dir = p2p_dir_save;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "Response: %s",
@@ -369,7 +369,7 @@ dissect_usb_dfu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
break;
case 0x03: /* Get Status */
@@ -406,9 +406,9 @@ dissect_usb_dfu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case 0x06: /* Abort */
default:
proto_tree_add_expert(command_tree, pinfo, &ei_unexpected_response, tvb, offset, 0);
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, -1);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
}
diff --git a/epan/dissectors/packet-usb-hid.c b/epan/dissectors/packet-usb-hid.c
index 02184e2910..681278e333 100644
--- a/epan/dissectors/packet-usb-hid.c
+++ b/epan/dissectors/packet-usb-hid.c
@@ -763,7 +763,7 @@ static const value_string usb_hid_report_type_vals[] = {
/* Dissector for HID class-specific control request as defined in
* USBHID 1.11, Chapter 7.2.
- * Returns tvb_length(tvb) if a class specific dissector was found
+ * Returns tvb_captured_length(tvb) if a class specific dissector was found
* and 0 otherwise.
*/
static gint
@@ -816,7 +816,7 @@ dissect_usb_hid_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
}
dissector(pinfo, tree, tvb, offset, is_request, usb_trans_info, usb_conv_info);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* dissect a descriptor that is specific to the HID class */
diff --git a/epan/dissectors/packet-usb-hub.c b/epan/dissectors/packet-usb-hub.c
index 33518718b6..be1b9d5e8f 100644
--- a/epan/dissectors/packet-usb-hub.c
+++ b/epan/dissectors/packet-usb-hub.c
@@ -606,7 +606,7 @@ static const usb_setup_dissector_table_t setup_dissectors[] = {
/* Dissector for USB HUB class-specific control request as defined in
* USB 2.0, Chapter 11.24.2 Class-specific Requests
- * Returns tvb_length(tvb) if a class specific dissector was found
+ * Returns tvb_captured_length(tvb) if a class specific dissector was found
* and 0 otherwise.
*/
static gint
@@ -657,7 +657,7 @@ dissect_usb_hub_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
}
dissector(pinfo, tree, tvb, offset, is_request, usb_trans_info, usb_conv_info);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-usb-masstorage.c b/epan/dissectors/packet-usb-masstorage.c
index 8ac950c1c2..b4aa7f0c87 100644
--- a/epan/dissectors/packet-usb-masstorage.c
+++ b/epan/dissectors/packet-usb-masstorage.c
@@ -124,7 +124,7 @@ static const value_string setup_request_names_vals[] = {
};
/* Dissector for mass storage control .
- * Returns tvb_length(tvb) if a class specific dissector was found
+ * Returns tvb_captured_length(tvb) if a class specific dissector was found
* and 0 othervise.
*/
static gint
@@ -171,7 +171,7 @@ dissect_usb_ms_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
}
dissector(pinfo, tree, tvb, offset, is_request, usb_trans_info, usb_conv_info);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -223,7 +223,7 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
/*
* SCSI CDB inside CBW
*/
- if(is_request&&(signature==0x43425355)&&(tvb_length(tvb)==31)){
+ if(is_request&&(signature==0x43425355)&&(tvb_captured_length(tvb)==31)){
tvbuff_t *cdb_tvb;
int cdbrlen, cdblen;
guint8 lun, flags;
@@ -292,21 +292,21 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
offset+=1;
cdblen=cdbrlen;
- if(cdblen>tvb_length_remaining(tvb, offset)){
- cdblen=tvb_length_remaining(tvb, offset);
+ if(cdblen>tvb_captured_length_remaining(tvb, offset)){
+ cdblen=tvb_captured_length_remaining(tvb, offset);
}
if(cdblen){
cdb_tvb=tvb_new_subset(tvb, offset, cdblen, cdbrlen);
dissect_scsi_cdb(cdb_tvb, pinfo, parent_tree, SCSI_DEV_UNKNOWN, itlq, itl);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
* SCSI RESPONSE inside CSW
*/
- if((!is_request)&&(signature==0x53425355)&&(tvb_length(tvb)==13)){
+ if((!is_request)&&(signature==0x53425355)&&(tvb_captured_length(tvb)==13)){
guint8 status;
/* dCSWSignature */
@@ -328,13 +328,13 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
itlq=(itlq_nexus_t *)wmem_tree_lookup32_le(usb_ms_conv_info->itlq, pinfo->fd->num);
if(!itlq){
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
itlq->last_exchange_frame=pinfo->fd->num;
itl=(itl_nexus_t *)wmem_tree_lookup32(usb_ms_conv_info->itl, itlq->lun);
if(!itl){
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if(!status){
@@ -343,7 +343,7 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
/* just send "check condition" */
dissect_scsi_rsp(tvb, pinfo, parent_tree, itlq, itl, 0x02);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -351,16 +351,16 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
*/
itlq=(itlq_nexus_t *)wmem_tree_lookup32_le(usb_ms_conv_info->itlq, pinfo->fd->num);
if(!itlq){
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
itl=(itl_nexus_t *)wmem_tree_lookup32(usb_ms_conv_info->itl, itlq->lun);
if(!itl){
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dissect_scsi_payload(tvb, pinfo, parent_tree, is_request, itlq, itl, 0);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
diff --git a/epan/dissectors/packet-usb-video.c b/epan/dissectors/packet-usb-video.c
index 1a82e20385..4c6b741e24 100644
--- a/epan/dissectors/packet-usb-video.c
+++ b/epan/dissectors/packet-usb-video.c
@@ -1478,7 +1478,7 @@ dissect_usb_vid_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
descriptor_len = tvb_get_guint8(tvb, offset);
descriptor_type = tvb_get_guint8(tvb, offset+1);
- bytes_available = tvb_length_remaining(tvb, offset);
+ bytes_available = tvb_captured_length_remaining(tvb, offset);
desc_tvb = tvb_new_subset(tvb, 0, bytes_available, descriptor_len);
if (descriptor_type == CS_ENDPOINT)
@@ -1559,7 +1559,7 @@ dissect_usb_vid_probe(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
offset += 26;
/* UVC 1.1 fields */
- if (tvb_length_remaining(tvb, offset) > 0)
+ if (tvb_captured_length_remaining(tvb, offset) > 0)
{
static const int *framing_bits[] = {
&hf_usb_vid_probe_framing_D[0],
@@ -2056,7 +2056,7 @@ dissect_usb_vid_interrupt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
int offset = 0;
usb_conv_info = (usb_conv_info_t *)data;
- bytes_available = tvb_length_remaining(tvb, offset);
+ bytes_available = tvb_captured_length_remaining(tvb, offset);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBVIDEO");
diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c
index 72f71e67fc..837aad92bd 100644
--- a/epan/dissectors/packet-user_encap.c
+++ b/epan/dissectors/packet-user_encap.c
@@ -147,7 +147,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
}
}
- len = tvb_length(tvb) - (encap->header_size + encap->trailer_size);
+ len = tvb_captured_length(tvb) - (encap->header_size + encap->trailer_size);
reported_len = tvb_reported_length(tvb) - (encap->header_size + encap->trailer_size);
payload_tvb = tvb_new_subset(tvb, encap->header_size, len, reported_len);
diff --git a/epan/dissectors/packet-uts.c b/epan/dissectors/packet-uts.c
index 24fbce752e..a4bb22a520 100644
--- a/epan/dissectors/packet-uts.c
+++ b/epan/dissectors/packet-uts.c
@@ -75,7 +75,7 @@ static int testchar(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, int op, g
{
gchar temp;
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
temp = tvb_get_guint8(tvb, offset) & 0x7f;
if (op == FETCH || (op == MATCH && temp == match)) {
if (storage != NULL)
@@ -238,7 +238,7 @@ dissect_uts(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
}
}
- while (tvb_length_remaining(tvb, offset) > 0) { /* now look for the ETX */
+ while (tvb_captured_length_remaining(tvb, offset) > 0) { /* now look for the ETX */
if ((tvb_get_guint8(tvb, offset) & 0x7f) == ETX) {
if (header_length == -1)
header_length = offset; /* the header ends at an STX, or if not found, the ETX */
@@ -248,7 +248,7 @@ dissect_uts(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
}
offset++;
}
- if (tvb_length_remaining(tvb, offset)) /* if there is anything left, it could be the BCC and pads */
+ if (tvb_captured_length_remaining(tvb, offset)) /* if there is anything left, it could be the BCC and pads */
bcc_start = offset;
if (tree) {
@@ -300,7 +300,7 @@ dissect_uts(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
if (stx_start) {
proto_tree_add_protocol_format(uts_header_tree, proto_uts, tvb, stx_start, 1, "Start of Text");
- length = tvb_length_remaining(tvb, stx_start+1); /* find out how much message remains */
+ length = tvb_captured_length_remaining(tvb, stx_start+1); /* find out how much message remains */
if (etx_start)
length = (etx_start - stx_start - 1); /* and the data part is the rest... */
/* whatever preceeds the ETX if it exists */
diff --git a/epan/dissectors/packet-v150fw.c b/epan/dissectors/packet-v150fw.c
index 3c8148cdc2..025906a5bc 100644
--- a/epan/dissectors/packet-v150fw.c
+++ b/epan/dissectors/packet-v150fw.c
@@ -256,7 +256,7 @@ dissect_v150fw_heur(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_)
guint8 octet1;
guint8 extb, ric;
guint16 ric_info;
- gint payload_length = tvb_length(tvb);
+ gint payload_length = tvb_captured_length(tvb);
unsigned int offset = 0;
/* see appendix C (State Signalling Events) in ITU-T Rec. V.150.1 for details */
@@ -320,7 +320,7 @@ dissect_v150fw(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *da
ti = proto_tree_add_item(tree, proto_v150fw, tvb, 0, -1, ENC_NA);
v150fw_tree = proto_item_add_subtree(ti, ett_v150fw);
- payload_length = tvb_length(tvb);
+ payload_length = tvb_captured_length(tvb);
/* Get fields needed for further dissection */
extb = tvb_get_guint8(tvb, offset) & 0x01; /* extension bit */
@@ -401,7 +401,7 @@ dissect_v150fw(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-v52.c b/epan/dissectors/packet-v52.c
index e8d9f926cf..f72fddeecc 100644
--- a/epan/dissectors/packet-v52.c
+++ b/epan/dissectors/packet-v52.c
@@ -963,11 +963,11 @@ dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
else if(buffer<=0x1a)
proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+3,1,ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+4)){
+ if(tvb_captured_length_remaining(info_tvb, info_offset+4)){
proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+4,1,ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+4,1,ENC_BIG_ENDIAN);
}
- if(tvb_length_remaining(info_tvb, info_offset+5)){
+ if(tvb_captured_length_remaining(info_tvb, info_offset+5)){
proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+5,1,ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+5,1,ENC_BIG_ENDIAN);
}
@@ -1045,7 +1045,7 @@ dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"), info_element);
proto_tree_add_item(info_tree, hf_v52_cause_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+3))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+3))
proto_tree_add_uint_format(info_tree, hf_v52_msg_type, info_tvb, info_offset+3, 1, tvb_get_guint8(info_tvb, info_offset+3),
"Diagnostic: %s",val_to_str_const(tvb_get_guint8(info_tvb, info_offset+3), msg_type_values,"unknown"));
@@ -1760,21 +1760,21 @@ dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
col_append_fstr(pinfo->cinfo, COL_INFO, " | V5MSlink ID:%u",tvb_get_guint8(info_tvb, info_offset+2));
- if(tvb_length_remaining(info_tvb, info_offset+3))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+3))
proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+4))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+4))
proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+5))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+5))
proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+5, info_element_length, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+6))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+6))
proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+6, info_element_length, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+7))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+7))
proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+7, info_element_length, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+8))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+8))
proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+8, info_element_length, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+9))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+9))
proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+9, info_element_length, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+10))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+10))
proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+10, info_element_length, ENC_BIG_ENDIAN);
}
}
@@ -1843,9 +1843,9 @@ dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
col_append_str(pinfo->cinfo, COL_INFO, " | ");
col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, bcc_protocol_error_cause_type_values, "Unknown element"));
- if(tvb_length_remaining(info_tvb, info_offset+3))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+3))
proto_tree_add_item(info_tree, hf_v52_diagnostic_message, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN);
- if(tvb_length_remaining(info_tvb, info_offset+4))
+ if(tvb_captured_length_remaining(info_tvb, info_offset+4))
proto_tree_add_item(info_tree, hf_v52_diagnostic_information, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN);
}
}
@@ -1936,7 +1936,7 @@ dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*int old_offset;*/
int singleoctet;
- while(tvb_length_remaining(tvb,offset) > 0){
+ while(tvb_captured_length_remaining(tvb,offset) > 0){
singleoctet = 0;
/* old_offset = offset; */
info_element = tvb_get_guint8(tvb, offset);
diff --git a/epan/dissectors/packet-v5dl.c b/epan/dissectors/packet-v5dl.c
index 0b5d378aa6..40518c1202 100644
--- a/epan/dissectors/packet-v5dl.c
+++ b/epan/dissectors/packet-v5dl.c
@@ -229,9 +229,9 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Check the checksum, if available.
* The checksum is a CCITT CRC-16 at the end of the packet, so
* if we don't have the entire packet in the capture - i.e., if
- * tvb_length(tvb) != tvb_reported_length(tvb) we can't check it.
+ * tvb_captured_length(tvb) != tvb_reported_length(tvb) we can't check it.
*/
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
/*
@@ -274,7 +274,7 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Remove the V5DL header *and* the checksum.
*/
next_tvb = tvb_new_subset(tvb, v5dl_header_len,
- tvb_length_remaining(tvb, v5dl_header_len) - 2,
+ tvb_captured_length_remaining(tvb, v5dl_header_len) - 2,
tvb_reported_length_remaining(tvb, v5dl_header_len) - 2);
} else {
/*
@@ -289,7 +289,7 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* and both bytes from the reported length.
*/
next_tvb = tvb_new_subset(tvb, v5dl_header_len,
- tvb_length_remaining(tvb, v5dl_header_len) - 1,
+ tvb_captured_length_remaining(tvb, v5dl_header_len) - 1,
tvb_reported_length_remaining(tvb, v5dl_header_len) - 2);
} else {
/*
@@ -299,7 +299,7 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* length.
*/
next_tvb = tvb_new_subset(tvb, v5dl_header_len,
- tvb_length_remaining(tvb, v5dl_header_len),
+ tvb_captured_length_remaining(tvb, v5dl_header_len),
tvb_reported_length_remaining(tvb, v5dl_header_len) - 2);
}
}
diff --git a/epan/dissectors/packet-v5ua.c b/epan/dissectors/packet-v5ua.c
index a50ef51f78..711f949832 100644
--- a/epan/dissectors/packet-v5ua.c
+++ b/epan/dissectors/packet-v5ua.c
@@ -342,7 +342,7 @@ dissect_draft_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *paramete
guint16 offset = MGMT_ERROR_MSG_HEADER_LENGTH + tvb_get_ntohs(parameter_tvb, MGMT_ERROR_MSG_LENGTH_OFFSET) + 4;
proto_tree_add_item(parameter_tree, hf_draft_error_code, parameter_tvb, offset, MGMT_ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
offset += MGMT_ERROR_CODE_LENGTH ;
- if( tvb_length_remaining(parameter_tvb,offset) > 0 )
+ if( tvb_captured_length_remaining(parameter_tvb,offset) > 0 )
proto_tree_add_item(parameter_tree, hf_info_string, parameter_tvb, offset, msg_length - offset,ENC_ASCII|ENC_NA);
}
/*----------------------Error Indication (Draft)-------------------------------*/
@@ -490,7 +490,7 @@ dissect_draft_tei_status_parameter(tvbuff_t *parameter_tvb, proto_tree *paramete
{
gint offset;
offset = tvb_get_ntohs(parameter_tvb, TEI_STATUS_LENGTH_OFFSET) + 8;
- if(tvb_length_remaining(parameter_tvb, offset) > 0 ){
+ if(tvb_captured_length_remaining(parameter_tvb, offset) > 0 ){
proto_tree_add_item(parameter_tree, hf_tei_draft_status, parameter_tvb, offset, TEI_STATUS_LENGTH, ENC_BIG_ENDIAN);
proto_item_append_text(parameter_item, " (%s)",
val_to_str_const(tvb_get_ntohl(parameter_tvb, offset), tei_draft_status_values, "Unknown TEI Status"));
@@ -903,13 +903,13 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *v5ua_
if((msg_class==0 || msg_class==1 || msg_class==9) && msg_type<=10)
length = msg_length;
}
- padding_length = tvb_length(parameter_tvb) - length;
+ padding_length = tvb_captured_length(parameter_tvb) - length;
paddingl = padding_length;
/* create proto_tree stuff */
switch(iua_version){
case RFC:
- parameter_item = proto_tree_add_text(v5ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s",
+ parameter_item = proto_tree_add_text(v5ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, 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_v5ua_parameter);
/* add tag to the v5ua tree */
@@ -917,7 +917,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *v5ua_
break;
case DRAFT:
default:
- parameter_item = proto_tree_add_text(v5ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s",
+ parameter_item = proto_tree_add_text(v5ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s",
val_to_str_const(tag, parameter_tag_draft_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_v5ua_parameter);
@@ -1031,7 +1031,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
offset = 0;
- while((remaining_length = tvb_length_remaining(parameters_tvb, offset))) {
+ while((remaining_length = tvb_captured_length_remaining(parameters_tvb, offset))) {
tag = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_TAG_OFFSET);
length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET);
if(iua_version==DRAFT){
@@ -1318,7 +1318,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
if (v5ua_tree) {
/* create proto_tree stuff */
- common_header_item = proto_tree_add_text(v5ua_tree, common_header_tvb, COMMON_HEADER_OFFSET, tvb_length(common_header_tvb),"Common Msg-Header");
+ common_header_item = proto_tree_add_text(v5ua_tree, common_header_tvb, COMMON_HEADER_OFFSET, tvb_captured_length(common_header_tvb),"Common Msg-Header");
common_header_tree = proto_item_add_subtree(common_header_item, ett_v5ua_common_header);
/* add the components of the common header to the protocol tree */
@@ -1412,7 +1412,7 @@ dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
iua_version = RFC;
offset = COMMON_HEADER_LENGTH;
- remaining_length = tvb_length_remaining(tvb, offset);
+ remaining_length = tvb_captured_length_remaining(tvb, offset);
while(remaining_length) {
tag = tvb_get_ntohs(tvb, offset);
@@ -1461,7 +1461,7 @@ dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else{
offset+=2;
- remaining_length = tvb_length_remaining(tvb, offset);
+ remaining_length = tvb_captured_length_remaining(tvb, offset);
}
/* add a notice for the draft version */
if(iua_version == DRAFT){
diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c
index 92276aada9..7cccfd7dbc 100644
--- a/epan/dissectors/packet-vines.c
+++ b/epan/dissectors/packet-vines.c
@@ -374,7 +374,7 @@ dissect_vines_frp_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return 0;
}
dissect_vines_frp(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-vlan.c b/epan/dissectors/packet-vlan.c
index 4479ce67cb..92374da90c 100644
--- a/epan/dissectors/packet-vlan.c
+++ b/epan/dissectors/packet-vlan.c
@@ -180,7 +180,7 @@ dissect_vlan(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, 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-vnc.c b/epan/dissectors/packet-vnc.c
index c3b5f3f42d..22d160a57e 100644
--- a/epan/dissectors/packet-vnc.c
+++ b/epan/dissectors/packet-vnc.c
@@ -495,7 +495,7 @@ static guint vnc_h264_encoding(tvbuff_t *tvb, gint *offset, proto_tree *tree);
pinfo->destport == vnc_preference_alternate_port
#define VNC_BYTES_NEEDED(a) \
- if(a > (guint)tvb_length_remaining(tvb, *offset)) \
+ if(a > (guint)tvb_captured_length_remaining(tvb, *offset)) \
return a;
/* Variables for our preferences */
@@ -943,7 +943,7 @@ vnc_is_client_or_server_version_message(tvbuff_t *tvb, packet_info *pinfo, proto
{
proto_item *bug_item;
- if(tvb_length(tvb) != 12) {
+ if(tvb_captured_length(tvb) != 12) {
return FALSE;
}
@@ -1453,7 +1453,7 @@ vnc_startup_messages(tvbuff_t *tvb, packet_info *pinfo, gint offset,
tvb, offset, 3, ENC_NA);
offset += 3; /* Skip over 3 bytes of padding */
- if(tvb_length_remaining(tvb, offset) > 4) {
+ if(tvb_captured_length_remaining(tvb, offset) > 4) {
/* Sometimes the desktop name & length is skipped */
proto_tree_add_item(tree, hf_vnc_desktop_name_len,
tvb, offset, 4, ENC_BIG_ENDIAN);
@@ -1641,7 +1641,7 @@ vnc_server_to_client(tvbuff_t *tvb, packet_info *pinfo, gint *offset,
if(bytes_needed > 0 && vnc_preference_desegment &&
pinfo->can_desegment) {
- length_remaining = tvb_length_remaining(tvb, *offset);
+ length_remaining = tvb_captured_length_remaining(tvb, *offset);
pinfo->desegment_offset = start_offset;
pinfo->desegment_len = bytes_needed - length_remaining;
diff --git a/epan/dissectors/packet-vntag.c b/epan/dissectors/packet-vntag.c
index 16a9232f29..b14cfece81 100644
--- a/epan/dissectors/packet-vntag.c
+++ b/epan/dissectors/packet-vntag.c
@@ -85,7 +85,7 @@ dissect_vntag(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, 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-vrrp.c b/epan/dissectors/packet-vrrp.c
index 898954ea1f..cc4d98249b 100644
--- a/epan/dissectors/packet-vrrp.c
+++ b/epan/dissectors/packet-vrrp.c
@@ -174,7 +174,7 @@ dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
cksum = tvb_get_ntohs(tvb, offset);
vrrp_len = (gint)tvb_reported_length(tvb);
- if (!pinfo->fragmented && (gint)tvb_length(tvb) >= vrrp_len) {
+ if (!pinfo->fragmented && (gint)tvb_captured_length(tvb) >= vrrp_len) {
/* The packet isn't part of a fragmented datagram
and isn't truncated, so we can checksum it. */
switch(hi_nibble(ver_type)) {
diff --git a/epan/dissectors/packet-wassp.c b/epan/dissectors/packet-wassp.c
index aa0b7e8d76..ab2bdead8d 100644
--- a/epan/dissectors/packet-wassp.c
+++ b/epan/dissectors/packet-wassp.c
@@ -980,7 +980,7 @@ static gboolean
test_wassp(tvbuff_t *tvb)
{
/* Minimum of 8 bytes, first byte (version) has value of 3 */
- if ( tvb_length(tvb) < 8
+ if ( tvb_captured_length(tvb) < 8
|| tvb_get_guint8(tvb, 0) != 3
/* || tvb_get_guint8(tvb, 2) != 0
|| tvb_get_ntohs(tvb, 6) > tvb_reported_length(tvb) */
diff --git a/epan/dissectors/packet-waveagent.c b/epan/dissectors/packet-waveagent.c
index a90ec93064..818d05d94a 100644
--- a/epan/dissectors/packet-waveagent.c
+++ b/epan/dissectors/packet-waveagent.c
@@ -1007,7 +1007,7 @@ static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
guint32 wa_payload_offset;
/* Check that there's enough data */
- if (tvb_length(tvb) < 52 )
+ if (tvb_captured_length(tvb) < 52 )
return 0;
magic_number = tvb_get_ntohl(tvb, 16) & 0x0FFFFFFF; /* Mask magic number off */
@@ -1076,7 +1076,7 @@ static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
/* Return the amount of data this dissector was able to dissect */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean dissect_waveagent_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
diff --git a/epan/dissectors/packet-wccp.c b/epan/dissectors/packet-wccp.c
index 07e8fed675..1d0feded2c 100644
--- a/epan/dissectors/packet-wccp.c
+++ b/epan/dissectors/packet-wccp.c
@@ -523,7 +523,7 @@ find_wccp_address_table(tvbuff_t *tvb, int offset, guint16 length,
type = tvb_get_ntohs(tvb, offset);
item_length = tvb_get_ntohs(tvb, offset+2);
- if (item_length > tvb_length_remaining(tvb, offset))
+ if (item_length > tvb_captured_length_remaining(tvb, offset))
return;
if (type == WCCP2r1_ADDRESS_TABLE)
@@ -764,7 +764,7 @@ dissect_wccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -921,12 +921,12 @@ dissect_wccp2_info(tvbuff_t *tvb, int offset, guint16 length,
item_length = tvb_get_ntohs(tvb, offset+2);
- if (item_length > tvb_length_remaining(tvb, offset)) {
+ if (item_length > tvb_captured_length_remaining(tvb, offset)) {
tf = proto_tree_add_text(wccp_tree, tvb, offset, length,
"Excessive WCCP Length values");
expert_add_info_format(pinfo, tf, &ei_wccp_length_bad,
"The length of the item is %d but there are only %d bytes remaining in the packet, I counted %d remaining",
- item_length, tvb_length_remaining(tvb, offset), length);
+ item_length, tvb_captured_length_remaining(tvb, offset), length);
break;
}
switch (type) {
diff --git a/epan/dissectors/packet-websocket.c b/epan/dissectors/packet-websocket.c
index 1f473af28d..a4e0047a5e 100644
--- a/epan/dissectors/packet-websocket.c
+++ b/epan/dissectors/packet-websocket.c
@@ -170,7 +170,7 @@ dissect_websocket_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, p
if (mask) {
payload_tvb = tvb_unmasked(tvb, offset, payload_length, masking_key);
tvb_set_child_real_data_tvbuff(tvb, payload_tvb);
- add_new_data_source(pinfo, payload_tvb, payload_length > tvb_length(payload_tvb) ? "Unmasked Data (truncated)" : "Unmasked Data");
+ add_new_data_source(pinfo, payload_tvb, payload_length > tvb_captured_length(payload_tvb) ? "Unmasked Data (truncated)" : "Unmasked Data");
ti = proto_tree_add_item(ws_tree, hf_ws_payload_unmask, payload_tvb, offset, payload_length, ENC_NA);
mask_tree = proto_item_add_subtree(ti, ett_ws_mask);
} else {
@@ -316,7 +316,7 @@ dissect_websocket(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
const guint8 *masking_key = NULL;
tvbuff_t *tvb_payload;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length < 2) {
pinfo->desegment_len = 2;
return 0;
diff --git a/epan/dissectors/packet-whois.c b/epan/dissectors/packet-whois.c
index c9d70ed5e2..d8dcaf88cf 100644
--- a/epan/dissectors/packet-whois.c
+++ b/epan/dissectors/packet-whois.c
@@ -78,7 +78,7 @@ dissect_whois(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation_add_proto_data(conversation, proto_whois, whois_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-wifi-p2p.c b/epan/dissectors/packet-wifi-p2p.c
index bf541597e0..95632ad939 100644
--- a/epan/dissectors/packet-wifi-p2p.c
+++ b/epan/dissectors/packet-wifi-p2p.c
@@ -1005,7 +1005,7 @@ void dissect_wifi_p2p_anqp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- while (tvb_length_remaining(tvb, offset) >= (request ? 4 : 5)) {
+ while (tvb_captured_length_remaining(tvb, offset) >= (request ? 4 : 5)) {
guint16 len;
proto_tree *tlv;
guint8 type, id, sd_proto;
@@ -1015,7 +1015,7 @@ void dissect_wifi_p2p_anqp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
expert_add_info_format(pinfo, item, &ei_wifi_p2p_anqp_length, "Too short Service TLV field");
return;
}
- if (len > tvb_length_remaining(tvb, offset + 2)) {
+ if (len > tvb_captured_length_remaining(tvb, offset + 2)) {
expert_add_info_format(pinfo, item, &ei_wifi_p2p_anqp_length, "Too short frame for Service TLV field");
return;
}
@@ -1049,7 +1049,7 @@ void dissect_wifi_p2p_anqp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
offset += len;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
expert_add_info(pinfo, item, &ei_wifi_p2p_anqp_unexpected_padding);
}
}
diff --git a/epan/dissectors/packet-winsrepl.c b/epan/dissectors/packet-winsrepl.c
index b351f69996..17c01b8d91 100644
--- a/epan/dissectors/packet-winsrepl.c
+++ b/epan/dissectors/packet-winsrepl.c
@@ -691,7 +691,7 @@ dissect_winsrepl_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -707,7 +707,7 @@ static int
dissect_winsrepl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, parent_tree, winsrepl_reassemble, 4, get_winsrepl_pdu_len, dissect_winsrepl_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-wlccp.c b/epan/dissectors/packet-wlccp.c
index 19b134edbb..33e545cea4 100644
--- a/epan/dissectors/packet-wlccp.c
+++ b/epan/dissectors/packet-wlccp.c
@@ -1009,7 +1009,7 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(get_tlv_flag() || get_mic_flag())
{
- if (tvb_length_remaining(tvb,offset) < 4)
+ if (tvb_captured_length_remaining(tvb,offset) < 4)
{
/* something is wrong if the TLV flag is set and there's not enough left in the buffer */
@@ -1019,7 +1019,7 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
- while (tvb_length_remaining(tvb,offset) >= 4)
+ while (tvb_captured_length_remaining(tvb,offset) >= 4)
{
old_offset = offset;
offset = dissect_wlccp_tlvs(wlccp_tree, tvb, offset, 0);
@@ -2010,9 +2010,9 @@ static guint dissect_wlccp_tlvs( proto_tree *_tree, tvbuff_t *_tvb, guint _offse
DISSECTOR_ASSERT(_offset > _old_offset);
} /* while bytes_left >= 4*/
- } /* _container_flag && (tvb_length_remaining(_tvb,_offset) >= 4) */
+ } /* _container_flag && (tvb_captured_length_remaining(_tvb,_offset) >= 4) */
- } /*_container_flag && (tvb_length_remaining(_tvb,_offset) < 4) */
+ } /*_container_flag && (tvb_captured_length_remaining(_tvb,_offset) < 4) */
/* done with decoding the contained TLVs */
diff --git a/epan/dissectors/packet-wol.c b/epan/dissectors/packet-wol.c
index 046a301206..8f84c12e11 100644
--- a/epan/dissectors/packet-wol.c
+++ b/epan/dissectors/packet-wol.c
@@ -98,7 +98,7 @@ dissect_wol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
* in Wireshark handing an HTTP packet to your dissector). For example:
*/
/* Check that there's enough data */
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if ( len < 102 ) /* wol's smallest packet size is 102 */
return (0);
diff --git a/epan/dissectors/packet-wow.c b/epan/dissectors/packet-wow.c
index f6006d29e4..a331112a2f 100644
--- a/epan/dissectors/packet-wow.c
+++ b/epan/dissectors/packet-wow.c
@@ -398,7 +398,7 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index 2c2fef9107..282536e706 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -1741,7 +1741,7 @@ static void
add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
{
guint8 hdr_id, val_id, codepage = 1;
- gint32 tvb_len = tvb_length(tvb);
+ gint32 tvb_len = tvb_captured_length(tvb);
gint32 offset = 0;
gint32 hdr_len, hdr_start;
gint32 val_len, val_start;
@@ -4645,7 +4645,7 @@ add_addresses(proto_tree *tree, tvbuff_t *tvb, int hf)
guint8 address_flags_len;
int address_len;
proto_tree *address_flags_tree;
- guint32 tvb_len = tvb_length(tvb);
+ guint32 tvb_len = tvb_captured_length(tvb);
guint32 offset = 0;
guint32 idx = 0; /* Address index */
guint32 address_record_len; /* Length of the entire address record */
diff --git a/epan/dissectors/packet-wtls.c b/epan/dissectors/packet-wtls.c
index c969c6ac5f..29f30c1600 100644
--- a/epan/dissectors/packet-wtls.c
+++ b/epan/dissectors/packet-wtls.c
@@ -367,7 +367,7 @@ dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
count += offset-offset_wtls;
}
else {
- count = tvb_length_remaining (tvb, offset_wtls);
+ count = tvb_captured_length_remaining (tvb, offset_wtls);
}
ti = proto_tree_add_uint(wtls_tree, hf_wtls_record, tvb, offset_wtls,
count, pdut);
@@ -394,7 +394,7 @@ dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset+=2;
}
else {
- count = tvb_length_remaining (tvb, offset);
+ count = tvb_captured_length_remaining (tvb, offset);
}
if (pdut & WTLS_RECORD_TYPE_CIPHER_CUR) {
diff --git a/epan/dissectors/packet-wtp.c b/epan/dissectors/packet-wtp.c
index b3ef980973..13390cd7b7 100644
--- a/epan/dissectors/packet-wtp.c
+++ b/epan/dissectors/packet-wtp.c
@@ -278,7 +278,7 @@ wtp_handle_tpi(proto_tree *tree, tvbuff_t *tvb)
else
tLen = tByte & 0x03;
pi = proto_tree_add_uint(tree, hf_wtp_tpi_type,
- tvb, 0, tvb_length(tvb), tType);
+ tvb, 0, tvb_captured_length(tvb), tType);
subTree = proto_item_add_subtree(pi, ett_tpilist);
switch (tType) {
case 0x00: /* Error*/
@@ -402,7 +402,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
printf("WTP packet %u: tree = %p, pdu = %s (%u) length: %u\n",
pinfo->fd->num, tree,
val_to_str(pdut, vals_wtp_pdu_type, "Unknown PDU type 0x%x"),
- pdut, tvb_length(tvb));
+ pdut, tvb_captured_length(tvb));
#endif
/* Develop the string to put in the Info column */
diff --git a/epan/dissectors/packet-x224.c b/epan/dissectors/packet-x224.c
index a5d53c0a7e..f6f8d50e85 100644
--- a/epan/dissectors/packet-x224.c
+++ b/epan/dissectors/packet-x224.c
@@ -112,7 +112,7 @@ dissect_x224_cr(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int off
proto_tree_add_item(tree, hf_x224_class, tvb, offset, 1, ENC_BIG_ENDIAN);
offset+=1;
- if(tvb_length_remaining(tvb, offset) > 0) {
+ if(tvb_captured_length_remaining(tvb, offset) > 0) {
len = tvb_find_line_end(tvb, offset, -1, &next_offset, TRUE);
proto_tree_add_item(tree, hf_x224_rdp_rt, tvb, offset, len,
ENC_ASCII|ENC_NA);
diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c
index 8cbfd525f0..912e3edae7 100644
--- a/epan/dissectors/packet-x25.c
+++ b/epan/dissectors/packet-x25.c
@@ -1535,7 +1535,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*
* We don't know what it is; just skip it.
*/
- localoffset = tvb_length(tvb);
+ localoffset = tvb_captured_length(tvb);
} else if (is_x_264) {
/* It looks like an X.264 UN TPDU, so show it as such. */
if (userdata_tree) {
@@ -2040,7 +2040,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (payload_check_data){
/* If the Call Req. has not been captured, let's look at the first
two bytes of the payload to see if this looks like COTP. */
- if (tvb_get_guint8(tvb, localoffset) == tvb_length(next_tvb)-1) {
+ if (tvb_get_guint8(tvb, localoffset) == tvb_captured_length(next_tvb)-1) {
/* First byte contains the length of the remaining buffer */
if ((tvb_get_guint8(tvb, localoffset+1) & 0x0F) == 0) {
/* Second byte contains a valid COTP TPDU */
diff --git a/epan/dissectors/packet-x29.c b/epan/dissectors/packet-x29.c
index 528a460b63..b9ea028418 100644
--- a/epan/dissectors/packet-x29.c
+++ b/epan/dissectors/packet-x29.c
@@ -237,7 +237,7 @@ dissect_x29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-x2ap.c b/epan/dissectors/packet-x2ap.c
index 88b899b849..94d8fda4f9 100644
--- a/epan/dissectors/packet-x2ap.c
+++ b/epan/dissectors/packet-x2ap.c
@@ -1334,7 +1334,7 @@ dissect_x2ap_PLMN_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
3, 3, FALSE, &parameter_tvb);
- if(tvb_length(tvb)==0)
+ if(tvb_captured_length(tvb)==0)
return offset;
if (!parameter_tvb)
@@ -2410,7 +2410,7 @@ dissect_x2ap_TransportLayerAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
if (!parameter_tvb)
return offset;
/* Get the length */
- tvb_len = tvb_length(parameter_tvb);
+ tvb_len = tvb_captured_length(parameter_tvb);
subtree = proto_item_add_subtree(actx->created_item, ett_x2ap_TransportLayerAddress);
if (tvb_len==4){
/* IPv4 */
@@ -5428,27 +5428,27 @@ static void dissect_X2AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/epan/dissectors/packet-x509if.c b/epan/dissectors/packet-x509if.c
index fe6cae6de4..0c65bd829e 100644
--- a/epan/dissectors/packet-x509if.c
+++ b/epan/dissectors/packet-x509if.c
@@ -787,7 +787,7 @@ dissect_x509if_T_atadv_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
if(out_tvb) {
/* it was a string - format it */
- value = tvb_format_text(out_tvb, 0, tvb_length(out_tvb));
+ value = tvb_format_text(out_tvb, 0, tvb_captured_length(out_tvb));
if(last_rdn) {
g_strlcat(last_rdn, value, MAX_RDN_STR_LEN);
diff --git a/epan/dissectors/packet-x509sat.c b/epan/dissectors/packet-x509sat.c
index 1c6a8cd898..30591327b4 100644
--- a/epan/dissectors/packet-x509sat.c
+++ b/epan/dissectors/packet-x509sat.c
@@ -1626,7 +1626,7 @@ dissect_x509sat_GUID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
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;
}
diff --git a/epan/dissectors/packet-xcsl.c b/epan/dissectors/packet-xcsl.c
index 3e6b90dd23..2abc3be958 100644
--- a/epan/dissectors/packet-xcsl.c
+++ b/epan/dissectors/packet-xcsl.c
@@ -306,7 +306,7 @@ static gboolean dissect_xcsl_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_t
gint offset = 0;
guint8 *protocol;
- if (tvb_length_remaining (tvb, offset) >= 5) {
+ if (tvb_captured_length_remaining (tvb, offset) >= 5) {
protocol = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 5, ENC_ASCII);
if (strncmp(protocol,"xcsl",4) == 0 && (protocol[4] == ';' || protocol[4] == '-')) {
diff --git a/epan/dissectors/packet-xmcp.c b/epan/dissectors/packet-xmcp.c
index d087cb56c2..bbd39c56f7 100644
--- a/epan/dissectors/packet-xmcp.c
+++ b/epan/dissectors/packet-xmcp.c
@@ -944,7 +944,7 @@ dissect_xmcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
msg_length = tvb_get_ntohs(tvb, 2);
if ((guint)(msg_length + XMCP_HDR_LEN) > tvb_reported_length(tvb)) {
expert_add_info_format(pinfo, ti, &ei_xmcp_length_bad, "XMCP message length (%u-byte header + %u) exceeds packet length (%u)", XMCP_HDR_LEN, msg_length, tvb_reported_length(tvb));
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* ...a 4 byte magic cookie... */
@@ -1051,7 +1051,7 @@ dissect_xmcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1059,14 +1059,14 @@ dissect_xmcp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, XMCP_HDR_LEN,
get_xmcp_message_len, dissect_xmcp_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
dissect_xmcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
/* See if this looks like a real XMCP packet */
- if (tvb_length(tvb) < XMCP_HDR_LEN) {
+ if (tvb_captured_length(tvb) < XMCP_HDR_LEN) {
return FALSE;
}
/* Check for valid message type field */
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index 2e98786680..18c3d16884 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -239,8 +239,8 @@ static gboolean dissect_xml_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
return TRUE;
} else if (pref_heuristic_unicode) {
/* XXX - UCS-2, or UTF-16? */
- const guint8 *data_str = tvb_get_string_enc(NULL, tvb, 0, tvb_length(tvb), ENC_UCS_2|ENC_LITTLE_ENDIAN);
- tvbuff_t *unicode_tvb = tvb_new_child_real_data(tvb, data_str, tvb_length(tvb)/2, tvb_length(tvb)/2);
+ const guint8 *data_str = tvb_get_string_enc(NULL, tvb, 0, tvb_captured_length(tvb), ENC_UCS_2|ENC_LITTLE_ENDIAN);
+ tvbuff_t *unicode_tvb = tvb_new_child_real_data(tvb, data_str, tvb_captured_length(tvb)/2, tvb_captured_length(tvb)/2);
tvb_set_free_cb(unicode_tvb, g_free);
if (tvbparse_peek(tvbparse_init(unicode_tvb, 0, -1, NULL, want_ignore), want_heur)) {
add_new_data_source(pinfo, unicode_tvb, "UTF8");
diff --git a/epan/dissectors/packet-xot.c b/epan/dissectors/packet-xot.c
index ae12d5b791..241638787c 100644
--- a/epan/dissectors/packet-xot.c
+++ b/epan/dissectors/packet-xot.c
@@ -108,7 +108,7 @@ static gboolean x25_desegment = FALSE;
static guint get_xot_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
guint16 plen;
- int remain = tvb_length_remaining(tvb, offset);
+ int remain = tvb_captured_length_remaining(tvb, offset);
if ( remain < XOT_HEADER_LENGTH){
/* We did not get the data we asked for, use up what we can */
return remain;
@@ -127,7 +127,7 @@ static guint get_xot_pdu_len_mult(packet_info *pinfo _U_, tvbuff_t *tvb, int off
int offset_next = offset + XOT_HEADER_LENGTH + X25_MIN_HEADER_LENGTH;
int tvb_len;
- while (tvb_len = tvb_length_remaining(tvb, offset), tvb_len>0){
+ while (tvb_len = tvb_captured_length_remaining(tvb, offset), tvb_len>0){
guint16 plen = 0;
int modulo;
guint16 bytes0_1;
@@ -204,9 +204,9 @@ static int dissect_xot_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_add_fstr(pinfo->cinfo, COL_INFO, "XOT Version = %u, size = %u",
version, plen);
if (offset == 0 &&
- tvb_length_remaining(tvb, offset) > XOT_HEADER_LENGTH + plen )
+ tvb_captured_length_remaining(tvb, offset) > XOT_HEADER_LENGTH + plen )
col_append_fstr(pinfo->cinfo, COL_INFO, " TotX25: %d",
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_xot, tvb, offset, XOT_HEADER_LENGTH,
@@ -268,12 +268,12 @@ static int dissect_xot_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(xot_tree, hf_xot_pvc_resp_itf_name, tvb, hdr_offset, resp_itf_name_len, ENC_ASCII|ENC_NA);
} else {
next_tvb = tvb_new_subset(tvb, offset,
- MIN(plen, tvb_length_remaining(tvb, offset)), plen);
+ MIN(plen, tvb_captured_length_remaining(tvb, offset)), plen);
call_dissector(x25_handle, next_tvb, pinfo, tree);
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_xot_mult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
@@ -281,7 +281,7 @@ static int dissect_xot_mult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset = 0;
int len = get_xot_pdu_len_mult(pinfo, tvb, offset);
tvbuff_t *next_tvb;
- int offset_max = offset+MIN(len,tvb_length_remaining(tvb, offset));
+ int offset_max = offset+MIN(len,tvb_captured_length_remaining(tvb, offset));
proto_item *ti;
proto_tree *xot_tree;
@@ -296,16 +296,16 @@ static int dissect_xot_mult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
while (offset <= offset_max - XOT_HEADER_LENGTH){
int plen = get_xot_pdu_len(pinfo, tvb, offset);
next_tvb = tvb_new_subset(tvb, offset,plen, plen);
- /*MIN(plen,tvb_length_remaining(tvb, offset)),plen*/
+ /*MIN(plen,tvb_captured_length_remaining(tvb, offset)),plen*/
dissect_xot_pdu(next_tvb, pinfo, tree, data);
offset += plen;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_xot_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- int tvb_len = tvb_length(tvb);
+ int tvb_len = tvb_captured_length(tvb);
int len = 0;
if (tvb_len >= 2 && tvb_get_ntohs(tvb,0) != XOT_VERSION) {
diff --git a/epan/dissectors/packet-xtp.c b/epan/dissectors/packet-xtp.c
index 66800be0a1..980d0c1f48 100644
--- a/epan/dissectors/packet-xtp.c
+++ b/epan/dissectors/packet-xtp.c
@@ -325,7 +325,7 @@ static expert_field ei_xtp_spans_bad = EI_INIT;
/* dissector of each payload */
static int
dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
- guint32 len = tvb_length_remaining(tvb, offset);
+ guint32 len = tvb_captured_length_remaining(tvb, offset);
guint32 start = offset;
proto_item *ti, *ti2, *top_ti;
proto_tree *xtp_subtree;
@@ -442,7 +442,7 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
static int
dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint32 offset) {
- guint32 len = tvb_length_remaining(tvb, offset);
+ guint32 len = tvb_captured_length_remaining(tvb, offset);
guint32 start = offset;
proto_item *top_ti;
proto_tree *xtp_subtree;
@@ -518,7 +518,7 @@ dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static int
dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
- guint32 len = tvb_length_remaining(tvb, offset);
+ guint32 len = tvb_captured_length_remaining(tvb, offset);
guint32 start = offset;
proto_item *ti, *ti2;
proto_tree *xtp_subtree;
@@ -634,7 +634,7 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
static void
dissect_xtp_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, gboolean have_btag) {
- guint32 len = tvb_length_remaining(tvb, offset);
+ guint32 len = tvb_captured_length_remaining(tvb, offset);
proto_item *ti;
proto_tree *xtp_subtree;
guint64 btag;
@@ -661,7 +661,7 @@ dissect_xtp_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, gboolean have_
static void
dissect_xtp_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint32 offset) {
- guint32 len = tvb_length_remaining(tvb, offset);
+ guint32 len = tvb_captured_length_remaining(tvb, offset);
guint32 start = offset;
proto_item *top_ti;
proto_tree *xtp_subtree;
@@ -733,7 +733,7 @@ dissect_xtp_first(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
static void
dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint32 offset) {
- guint32 len = tvb_length_remaining(tvb, offset);
+ guint32 len = tvb_captured_length_remaining(tvb, offset);
guint32 start = offset;
proto_item *top_ti;
proto_tree *xtp_subtree;
@@ -854,7 +854,7 @@ dissect_xtp_jcntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static void
dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
- guint32 len = tvb_length_remaining(tvb, offset);
+ guint32 len = tvb_captured_length_remaining(tvb, offset);
guint32 start = offset;
proto_item *ti;
proto_tree *xtp_subtree;
@@ -879,7 +879,7 @@ dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) {
diag->val = tvb_get_ntohl(tvb, offset);
offset += 4;
/* message(n) */
- msg_len = tvb_length_remaining(tvb, offset);
+ msg_len = tvb_captured_length_remaining(tvb, offset);
diag->msg = tvb_get_string_enc(NULL, tvb, offset, msg_len, ENC_ASCII);
/** display **/
@@ -919,7 +919,7 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
guint16 computed_cksum;
gboolean have_btag;
- if ((len = tvb_length(tvb)) < XTP_HEADER_LEN)
+ if ((len = tvb_captured_length(tvb)) < XTP_HEADER_LEN)
return 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "XTP");
@@ -1124,7 +1124,7 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-yami.c b/epan/dissectors/packet-yami.c
index f8a2451114..f67be69cef 100644
--- a/epan/dissectors/packet-yami.c
+++ b/epan/dissectors/packet-yami.c
@@ -523,7 +523,7 @@ dissect_yami_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
#define FRAME_HEADER_LEN 16
@@ -540,7 +540,7 @@ static int
dissect_yami(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
tcp_dissect_pdus(tvb, pinfo, tree, yami_desegment, FRAME_HEADER_LEN, get_yami_message_len, dissect_yami_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-yhoo.c b/epan/dissectors/packet-yhoo.c
index 2df810adb5..2d92f9f8b4 100644
--- a/epan/dissectors/packet-yhoo.c
+++ b/epan/dissectors/packet-yhoo.c
@@ -186,7 +186,7 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
/* get at least a full packet structure */
- if ( tvb_length(tvb) < YAHOO_RAWPACKET_LEN ) {
+ if ( tvb_captured_length(tvb) < YAHOO_RAWPACKET_LEN ) {
/* Not enough data captured; maybe it is a Yahoo
Messenger packet, but it contains too little data to
tell. */
diff --git a/epan/dissectors/packet-ymsg.c b/epan/dissectors/packet-ymsg.c
index 0c3e108819..19fa6964d4 100644
--- a/epan/dissectors/packet-ymsg.c
+++ b/epan/dissectors/packet-ymsg.c
@@ -331,7 +331,7 @@ static int get_content_item_length(tvbuff_t *tvb, int offset)
int origoffset = offset;
/* Keep reading until the magic delimiter (or end of tvb) is found */
- while (tvb_length_remaining(tvb, offset) >= 2) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 2) {
if (tvb_get_ntohs(tvb, offset) == 0xc080) {
break;
}
@@ -469,14 +469,14 @@ dissect_ymsg_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
col_set_fence(pinfo->cinfo, COL_INFO);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
dissect_ymsg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if (tvb_length(tvb) < 4) {
+ if (tvb_captured_length(tvb) < 4) {
return FALSE;
}
if (tvb_memeql(tvb, 0, "YMSG", 4) == -1) {
diff --git a/epan/dissectors/packet-zbee-aps.c b/epan/dissectors/packet-zbee-aps.c
index 5f907bb4e3..29f1405074 100644
--- a/epan/dissectors/packet-zbee-aps.c
+++ b/epan/dissectors/packet-zbee-aps.c
@@ -671,7 +671,7 @@ dissect_zbee_aps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
memset(&packet, 0, sizeof(zbee_aps_packet));
/* Create the protocol tree */
- proto_root = proto_tree_add_protocol_format(tree, proto_zbee_aps, tvb, offset, tvb_length(tvb), "ZigBee Application Support Layer");
+ proto_root = proto_tree_add_protocol_format(tree, proto_zbee_aps, tvb, offset, tvb_captured_length(tvb), "ZigBee Application Support Layer");
aps_tree = proto_item_add_subtree(proto_root, ett_zbee_aps);
/* Set the protocol column, if the NWK layer hasn't already done so. */
@@ -776,7 +776,7 @@ dissect_zbee_aps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
else {
/* Illegal Delivery Mode. */
expert_add_info(pinfo, proto_root, &ei_zbee_aps_invalid_delivery_mode);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -911,15 +911,15 @@ dissect_zbee_aps_no_endpt:
}
/* If a payload is present, and security is enabled, decrypt the payload. */
- if ((offset < tvb_length(tvb)) && packet.security) {
+ if ((offset < tvb_captured_length(tvb)) && packet.security) {
payload_tvb = dissect_zbee_secure(tvb, pinfo, aps_tree, offset);
if (payload_tvb == NULL) {
/* If Payload_tvb is NULL, then the security dissector cleaned up. */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
/* If the payload exists, create a tvb subset. */
- else if (offset < tvb_length(tvb)) {
+ else if (offset < tvb_captured_length(tvb)) {
payload_tvb = tvb_new_subset_remaining(tvb, offset);
}
@@ -954,7 +954,7 @@ dissect_zbee_aps_no_endpt:
/* Add this fragment to the reassembly handler. */
frag_msg = fragment_add_seq_check(&zbee_aps_reassembly_table,
payload_tvb, 0, pinfo, msg_id, NULL,
- block_num, tvb_length(payload_tvb), TRUE);
+ block_num, tvb_captured_length(payload_tvb), TRUE);
new_tvb = process_reassembled_data(payload_tvb, 0, pinfo, "Reassembled ZigBee APS" ,
frag_msg, &zbee_aps_frag_items, NULL, aps_tree);
@@ -970,7 +970,7 @@ dissect_zbee_aps_no_endpt:
else {
/* The reassembly handler could not defragment the message. */
call_dissector(data_handle, payload_tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
@@ -993,17 +993,17 @@ dissect_zbee_aps_no_endpt:
break;
}
call_dissector_with_data(profile_handle, payload_tvb, pinfo, tree, nwk);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
case ZBEE_APS_FCF_CMD:
if (!payload_tvb) {
/* Command packets MUST contain a payload. */
expert_add_info(pinfo, proto_root, &ei_zbee_aps_missing_payload);
THROW(BoundsError);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dissect_zbee_aps_cmd(payload_tvb, pinfo, aps_tree, nwk->version, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
case ZBEE_APS_FCF_ACK:
/* Acks should never contain a payload. */
@@ -1026,7 +1026,7 @@ dissect_zbee_aps_no_endpt:
call_dissector(data_handle, payload_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbee_aps */
/*FUNCTION:------------------------------------------------------
@@ -1053,7 +1053,7 @@ static void dissect_zbee_aps_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
guint8 cmd_id = tvb_get_guint8(tvb, offset);
/* Create a subtree for the APS Command frame, and add the command ID to it. */
- cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_length(tvb),
+ cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_captured_length(tvb),
"Command Frame: %s", val_to_str_const(cmd_id, zbee_aps_cmd_names, "Unknown"));
cmd_tree = proto_item_add_subtree(cmd_root, ett_zbee_aps_cmd);
@@ -1123,7 +1123,7 @@ static void dissect_zbee_aps_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
} /* switch */
/* Check for any excess bytes. */
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
/* There are leftover bytes! */
proto_tree *root;
tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -1580,7 +1580,7 @@ dissect_zbee_aps_tunnel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
tunnel_tvb = tvb_new_subset_remaining(tvb, offset);
root = proto_tree_get_root(tree);
call_dissector_with_data(zbee_aps_handle, tunnel_tvb, pinfo, root, data);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
/* Done */
return offset;
@@ -1620,7 +1620,7 @@ static int dissect_zbee_apf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Create the tree for the application framework. */
proto_root = proto_tree_add_protocol_format(tree, proto_zbee_apf, tvb, 0,
- tvb_length(tvb), "ZigBee Application Framework");
+ tvb_captured_length(tvb), "ZigBee Application Framework");
apf_tree = proto_item_add_subtree(proto_root, ett_zbee_apf);
/* Get the count and type. */
@@ -1652,13 +1652,13 @@ static int dissect_zbee_apf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
dissect_app_end:
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
/* There are bytes remaining! */
app_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, app_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbee_apf */
/*FUNCTION:------------------------------------------------------
@@ -1682,7 +1682,7 @@ dissect_zbee_t2(tvbuff_t *tvb, proto_tree *tree, guint16 cluster_id)
proto_item *ti;
proto_tree *t2_tree;
- ti = proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "ZigBee Test Profile #2");
+ ti = proto_tree_add_text(tree, tvb, 0, tvb_captured_length(tvb), "ZigBee Test Profile #2");
t2_tree = proto_item_add_subtree(ti, ett_zbee_aps_t2);
switch (cluster_id) {
case ZBEE_APS_T2_CID_BTRES:
diff --git a/epan/dissectors/packet-zbee-nwk-gp.c b/epan/dissectors/packet-zbee-nwk-gp.c
index 43f4d2baec..f489835cea 100644
--- a/epan/dissectors/packet-zbee-nwk-gp.c
+++ b/epan/dissectors/packet-zbee-nwk-gp.c
@@ -1032,7 +1032,7 @@ dissect_zbee_nwk_gp_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
/* Create a subtree for the command. */
if (tree) {
- cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_length(tvb), "Command Frame: %s",
+ cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_captured_length(tvb), "Command Frame: %s",
val_to_str_ext_const(cmd_id,
&zbee_nwk_gp_cmd_names_ext,
"Unknown Command Frame"));
@@ -1267,11 +1267,11 @@ dissect_zbee_nwk_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZigBee Green Power");
col_clear(pinfo->cinfo, COL_INFO);
if (tree) {
- proto_root = proto_tree_add_protocol_format(tree, proto_zbee_nwk_gp, tvb, offset, tvb_length(tvb),
+ proto_root = proto_tree_add_protocol_format(tree, proto_zbee_nwk_gp, tvb, offset, tvb_captured_length(tvb),
"ZGP stub NWK header");
nwk_tree = proto_item_add_subtree(proto_root, ett_zbee_nwk);
}
- enc_buffer = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
+ enc_buffer = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_captured_length(tvb));
/* Get and parse the FCF. */
fcf = tvb_get_guint8(tvb, offset);
packet.frame_type = zbee_get_bit_field(fcf, ZBEE_NWK_GP_FCF_FRAME_TYPE);
@@ -1371,7 +1371,7 @@ dissect_zbee_nwk_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
}
/* Save packet private data. */
data = (void *)&packet;
- if ((offset < tvb_length(tvb)) && (packet.security_level != ZBEE_NWK_GP_SECURITY_LEVEL_FULLENCR)) {
+ if ((offset < tvb_captured_length(tvb)) && (packet.security_level != ZBEE_NWK_GP_SECURITY_LEVEL_FULLENCR)) {
THROW(BoundsError);
}
if (packet.security_level == ZBEE_NWK_GP_SECURITY_LEVEL_FULLENCR) {
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c
index 9527a6260f..1000a55ee4 100644
--- a/epan/dissectors/packet-zbee-nwk.c
+++ b/epan/dissectors/packet-zbee-nwk.c
@@ -395,7 +395,7 @@ dissect_zbee_nwk_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
col_clear(pinfo->cinfo, COL_INFO);
if (tree) {
proto_root = proto_tree_add_protocol_format(tree, proto_zbee_nwk, tvb, offset,
- tvb_length(tvb), "ZigBee Network Layer");
+ tvb_captured_length(tvb), "ZigBee Network Layer");
nwk_tree = proto_item_add_subtree(proto_root, ett_zbee_nwk);
}
@@ -652,7 +652,7 @@ dissect_zbee_nwk_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
* Ensure that the payload exists. There are no valid ZigBee network
* packets that have no payload.
*/
- if (offset >= tvb_length(tvb)) {
+ if (offset >= tvb_captured_length(tvb)) {
/* Non-existent or truncated payload. */
expert_add_info(pinfo, proto_root, &ei_zbee_nwk_missing_payload);
THROW(BoundsError);
@@ -662,7 +662,7 @@ dissect_zbee_nwk_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
payload_tvb = dissect_zbee_secure(tvb, pinfo, nwk_tree, offset);
if (payload_tvb == NULL) {
/* If Payload_tvb is NULL, then the security dissector cleaned up. */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
/* Plaintext payload. */
@@ -683,7 +683,7 @@ dissect_zbee_nwk_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
call_dissector(data_handle, payload_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbee_nwk */
/*FUNCTION:------------------------------------------------------
@@ -742,7 +742,7 @@ static void dissect_zbee_nwk_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Create a subtree for this command. */
if (tree) {
- cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_length(tvb), "Command Frame: %s",
+ cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_captured_length(tvb), "Command Frame: %s",
val_to_str_const(cmd_id, zbee_nwk_cmd_names, "Unknown"));
cmd_tree = proto_item_add_subtree(cmd_root, ett_zbee_nwk_cmd);
@@ -813,7 +813,7 @@ static void dissect_zbee_nwk_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
} /* switch */
/* There is excess data in the packet. */
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
/* There are leftover bytes! */
tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree *root = NULL;
@@ -1464,7 +1464,7 @@ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZigBee");
/* Create the tree for this beacon. */
if (tree) {
- beacon_root = proto_tree_add_protocol_format(tree, proto_zbee_nwk, tvb, 0, tvb_length(tvb), "ZigBee Beacon");
+ beacon_root = proto_tree_add_protocol_format(tree, proto_zbee_nwk, tvb, 0, tvb_captured_length(tvb), "ZigBee Beacon");
beacon_tree = proto_item_add_subtree(beacon_root, ett_zbee_beacon);
}
@@ -1511,7 +1511,7 @@ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset += 3;
/* Get and display the update ID. */
- if(tvb_length_remaining(tvb, offset)) {
+ if(tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(beacon_tree, hf_zbee_beacon_update_id, tvb, offset, 1, ENC_NA);
offset += 1;
}
@@ -1527,7 +1527,7 @@ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
}
/* Check for leftover bytes. */
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
/* Bytes leftover! */
tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree *root = NULL;
@@ -1542,7 +1542,7 @@ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
call_dissector(data_handle, leftover_tvb, pinfo, root);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbee_beacon */
/*FUNCTION:------------------------------------------------------
@@ -1603,7 +1603,7 @@ static int dissect_zbip_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZigBee IP");
/* Create the tree for this beacon. */
if (tree) {
- beacon_root = proto_tree_add_protocol_format(tree, proto_zbee_nwk, tvb, 0, tvb_length(tvb), "ZigBee IP Beacon");
+ beacon_root = proto_tree_add_protocol_format(tree, proto_zbee_nwk, tvb, 0, tvb_captured_length(tvb), "ZigBee IP Beacon");
beacon_tree = proto_item_add_subtree(beacon_root, ett_zbee_beacon);
}
@@ -1637,7 +1637,7 @@ static int dissect_zbip_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset += 16;
/* Check for leftover bytes. */
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
/* TODO: There are TLV's to parse. */
/* Bytes leftover! */
tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -1652,7 +1652,7 @@ static int dissect_zbip_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Dump the leftover to the data dissector. */
call_dissector(data_handle, leftover_tvb, pinfo, root);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbip_beacon */
/*FUNCTION:------------------------------------------------------
diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c
index cf3f5a815e..2a9ed7167c 100644
--- a/epan/dissectors/packet-zbee-security.c
+++ b/epan/dissectors/packet-zbee-security.c
@@ -455,7 +455,7 @@ dissect_zbee_secure(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree, guint o
/* Create a subtree for the security information. */
if (tree) {
- sec_root = proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "ZigBee Security Header");
+ sec_root = proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "ZigBee Security Header");
sec_tree = proto_item_add_subtree(sec_root, ett_zbee_sec);
}
@@ -474,7 +474,7 @@ dissect_zbee_secure(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree, guint o
* is automatically freed before the next packet is processed.
*/
#ifdef HAVE_LIBGCRYPT
- enc_buffer = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
+ enc_buffer = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_captured_length(tvb));
/*
* Override the const qualifiers and patch the security level field, we
* know it is safe to overide the const qualifiers because we just
@@ -597,7 +597,7 @@ dissect_zbee_secure(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree, guint o
if (mic_len) {
/* Display the MIC. */
if (tree) {
- proto_tree_add_item(sec_tree, hf_zbee_sec_mic, tvb, (gint)(tvb_length(tvb)-mic_len),
+ proto_tree_add_item(sec_tree, hf_zbee_sec_mic, tvb, (gint)(tvb_captured_length(tvb)-mic_len),
mic_len, ENC_NA);
}
}
diff --git a/epan/dissectors/packet-zbee-zcl-general.c b/epan/dissectors/packet-zbee-zcl-general.c
index 458e20b189..33739bce4c 100644
--- a/epan/dissectors/packet-zbee-zcl-general.c
+++ b/epan/dissectors/packet-zbee-zcl-general.c
@@ -223,7 +223,7 @@ dissect_zbee_zcl_basic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_basic*/
@@ -618,7 +618,7 @@ dissect_zbee_zcl_identify(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_identify*/
@@ -939,7 +939,7 @@ dissect_zbee_zcl_on_off(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
/*offset++;*/
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_on_off*/
/*FUNCTION:------------------------------------------------------
@@ -1318,7 +1318,7 @@ dissect_zbee_zcl_part(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_part*/
/*FUNCTION:------------------------------------------------------
@@ -2744,7 +2744,7 @@ dissect_zbee_zcl_ota(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_ota*/
/*FUNCTION:------------------------------------------------------
@@ -3275,7 +3275,7 @@ dissect_zbee_zcl_pwr_prof (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_pwr_prof*/
/*FUNCTION:------------------------------------------------------
@@ -4450,7 +4450,7 @@ dissect_zbee_zcl_appl_ctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-zbee-zcl-ha.c b/epan/dissectors/packet-zbee-zcl-ha.c
index a8a2f30154..6a0d3dd7fe 100644
--- a/epan/dissectors/packet-zbee-zcl-ha.c
+++ b/epan/dissectors/packet-zbee-zcl-ha.c
@@ -891,7 +891,7 @@ dissect_zbee_zcl_appl_evtalt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_appl_evtalt*/
/*FUNCTION:------------------------------------------------------
@@ -1316,7 +1316,7 @@ dissect_zbee_zcl_appl_stats (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_appl_stats*/
/*FUNCTION:------------------------------------------------------
diff --git a/epan/dissectors/packet-zbee-zcl-se.c b/epan/dissectors/packet-zbee-zcl-se.c
index cdb0f941f7..77ab8b0309 100644
--- a/epan/dissectors/packet-zbee-zcl-se.c
+++ b/epan/dissectors/packet-zbee-zcl-se.c
@@ -241,7 +241,7 @@ dissect_zbee_zcl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_msg*/
/*FUNCTION:------------------------------------------------------
diff --git a/epan/dissectors/packet-zbee-zcl.c b/epan/dissectors/packet-zbee-zcl.c
index bb01f72279..bb20079461 100644
--- a/epan/dissectors/packet-zbee-zcl.c
+++ b/epan/dissectors/packet-zbee-zcl.c
@@ -859,7 +859,7 @@ static int dissect_zbee_zcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Create the protocol tree */
if ( tree ) {
proto_root = proto_tree_add_protocol_format(tree, proto_zbee_zcl, tvb, offset,
- tvb_length(tvb), "ZigBee Cluster Library Frame");
+ tvb_captured_length(tvb), "ZigBee Cluster Library Frame");
zcl_tree = proto_item_add_subtree(proto_root, ett_zbee_zcl);
}
@@ -944,7 +944,7 @@ static int dissect_zbee_zcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (cluster_handle != NULL) {
/* Call the specific cluster dissector registered. */
call_dissector_with_data(cluster_handle, payload_tvb, pinfo, zcl_tree, &packet);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
proto_item_append_text(proto_root, ", Cluster-specific Command: 0x%02x, Seq: %u", packet.cmd_id,
packet.tran_seqno);
@@ -1266,7 +1266,7 @@ static int dissect_zbee_zcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Don't decode the tail. */
zcl_dump_data(tvb, offset, pinfo, zcl_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if ( zcl_tree ) {
@@ -1327,7 +1327,7 @@ static int dissect_zbee_zcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} /* switch */
}
zcl_dump_data(tvb, offset, pinfo, zcl_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbee_zcl */
/*FUNCTION:------------------------------------------------------
@@ -1349,7 +1349,7 @@ void dissect_zcl_read_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
{
guint tvb_len;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len ) {
/* Dissect the attribute identifier */
dissect_zcl_attr_id(tvb, tree, offset, cluster_id);
@@ -1381,7 +1381,7 @@ void dissect_zcl_read_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
guint i = 0;
guint16 attr_id;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
@@ -1426,7 +1426,7 @@ void dissect_zcl_write_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
guint i = 0;
guint16 attr_id;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
@@ -1465,7 +1465,7 @@ static void dissect_zcl_write_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, p
guint tvb_len;
guint i = 0;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
@@ -1509,7 +1509,7 @@ static void dissect_zcl_read_report_config_resp(tvbuff_t *tvb, packet_info *pinf
guint attr_dir;
guint16 attr_id;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
@@ -1579,7 +1579,7 @@ static void dissect_zcl_config_report(tvbuff_t *tvb, packet_info *pinfo _U_, pro
guint data_type;
guint16 attr_id;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
@@ -1646,7 +1646,7 @@ static void dissect_zcl_config_report_resp(tvbuff_t *tvb, packet_info *pinfo _U_
guint tvb_len;
guint i = 0;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
@@ -1689,7 +1689,7 @@ static void dissect_zcl_read_report_config(tvbuff_t *tvb, packet_info *pinfo _U_
guint tvb_len;
guint i = 0;
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
@@ -1794,7 +1794,7 @@ static void dissect_zcl_discover_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_
dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_dis);
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
@@ -2479,7 +2479,7 @@ dissect_zcl_set_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elem
static void zcl_dump_data(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
proto_tree *root = proto_tree_get_root(tree);
- guint length = tvb_length_remaining(tvb, offset);
+ guint length = tvb_captured_length_remaining(tvb, offset);
tvbuff_t *remainder;
if (length > 0) {
diff --git a/epan/dissectors/packet-zbee-zdp-binding.c b/epan/dissectors/packet-zbee-zdp-binding.c
index 1271dee0b9..f15f7af35b 100644
--- a/epan/dissectors/packet-zbee-zdp-binding.c
+++ b/epan/dissectors/packet-zbee-zdp-binding.c
@@ -516,7 +516,7 @@ dissect_zbee_zdp_req_backup_bind_table(tvbuff_t *tvb, packet_info *pinfo, proto_
table_count = zbee_parse_uint(tree, hf_zbee_zdp_table_count, tvb, &offset, (int)sizeof(guint16), NULL);
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Binding Table");
+ ti = proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Binding Table");
field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_bind);
}
for (i=0; i<table_count; i++) {
@@ -738,7 +738,7 @@ dissect_zbee_zdp_rsp_bind_register(tvbuff_t *tvb, packet_info *pinfo, proto_tree
table_count = zbee_parse_uint(tree, hf_zbee_zdp_table_count, tvb, &offset, (int)sizeof(guint16), NULL);
if (tree && table_count) {
- ti = proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Binding List");
+ ti = proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Binding List");
field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_bind);
}
for (i=0; i<table_count; i++) {
@@ -898,7 +898,7 @@ dissect_zbee_zdp_rsp_recover_bind_table(tvbuff_t *tvb, packet_info *pinfo, proto
table_count = zbee_parse_uint(tree, hf_zbee_zdp_table_count, tvb, &offset, (int)sizeof(guint16), NULL);
if (tree && table_count) {
- ti = proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Binding Table");
+ ti = proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Binding Table");
field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_bind);
}
for (i=0; i<table_count; i++) {
diff --git a/epan/dissectors/packet-zbee-zdp-management.c b/epan/dissectors/packet-zbee-zdp-management.c
index 3e11b80c83..da1bba92bb 100644
--- a/epan/dissectors/packet-zbee-zdp-management.c
+++ b/epan/dissectors/packet-zbee-zdp-management.c
@@ -593,7 +593,7 @@ dissect_zbee_zdp_rsp_mgmt_nwk_disc(tvbuff_t *tvb, packet_info *pinfo, proto_tree
table_count = zbee_parse_uint(tree, hf_zbee_zdp_table_count, tvb, &offset, 1, NULL);
if (tree && table_count) {
- ti = proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Network List");
+ ti = proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Network List");
field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_nwk);
}
for (i=0; i<table_count; i++) {
@@ -639,7 +639,7 @@ dissect_zbee_zdp_rsp_mgmt_lqi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
table_count = zbee_parse_uint(tree, hf_zbee_zdp_table_count, tvb, &offset, 1, NULL);
if (tree && table_count) {
- ti = proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Neighbor Table");
+ ti = proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Neighbor Table");
field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_lqi);
}
for (i=0; i<table_count; i++) {
@@ -731,7 +731,7 @@ dissect_zbee_zdp_rsp_mgmt_bind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
table_count = zbee_parse_uint(tree, hf_zbee_zdp_table_count, tvb, &offset, 1, NULL);
if (tree && table_count) {
- ti = proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Binding Table");
+ ti = proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Binding Table");
field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_bind);
}
for (i=0; i<table_count; i++) {
diff --git a/epan/dissectors/packet-zbee-zdp.c b/epan/dissectors/packet-zbee-zdp.c
index 2dab6aa99f..02207d6801 100644
--- a/epan/dissectors/packet-zbee-zdp.c
+++ b/epan/dissectors/packet-zbee-zdp.c
@@ -381,7 +381,7 @@ void
zdp_dump_excess(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
proto_tree *root = proto_tree_get_root(tree);
- guint length = tvb_length_remaining(tvb, offset);
+ guint length = tvb_captured_length_remaining(tvb, offset);
tvbuff_t *excess;
if (length > 0) {
@@ -727,7 +727,7 @@ zdp_parse_node_desc(proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offse
/*guint16 max_transfer;*/
if ((tree) && (ettindex != -1)) {
- field_root = proto_tree_add_text(tree, tvb, *offset, tvb_length_remaining(tvb, *offset), "Node Descriptor");
+ field_root = proto_tree_add_text(tree, tvb, *offset, tvb_captured_length_remaining(tvb, *offset), "Node Descriptor");
field_tree = proto_item_add_subtree(field_root, ettindex);
}
else field_tree = tree;
@@ -875,7 +875,7 @@ zdp_parse_simple_desc(proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *off
guint8 out_count;
if ((tree) && (ettindex != -1)) {
- field_root = proto_tree_add_text(tree, tvb, *offset, tvb_length_remaining(tvb, *offset), "Simple Descriptor");
+ field_root = proto_tree_add_text(tree, tvb, *offset, tvb_captured_length_remaining(tvb, *offset), "Simple Descriptor");
field_tree = proto_item_add_subtree(field_root, ettindex);
}
else field_tree = tree;
@@ -1034,7 +1034,7 @@ dissect_zbee_zdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
nwk = (zbee_nwk_packet *)data;
/* Create the protocol tree. */
- proto_root = proto_tree_add_protocol_format(tree, proto_zbee_zdp, tvb, offset, tvb_length(tvb), "ZigBee Device Profile");
+ proto_root = proto_tree_add_protocol_format(tree, proto_zbee_zdp, tvb, offset, tvb_captured_length(tvb), "ZigBee Device Profile");
zdp_tree = proto_item_add_subtree(proto_root, ett_zbee_zdp);
#if 0
@@ -1319,7 +1319,7 @@ dissect_zbee_zdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
break;
} /* switch */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbee_zdp */
/*FUNCTION:------------------------------------------------------
diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c
index 924bb08aa1..e6d98724dd 100644
--- a/epan/dissectors/packet-zep.c
+++ b/epan/dissectors/packet-zep.c
@@ -165,7 +165,7 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
#endif
- if(ieee_packet_len < tvb_length(tvb)-zep_header_len){
+ if(ieee_packet_len < tvb_captured_length(tvb)-zep_header_len){
/* Packet's length is mis-reported, abort dissection */
call_dissector(data_handle, tvb, pinfo, tree);
return;
diff --git a/epan/dissectors/packet-ziop.c b/epan/dissectors/packet-ziop.c
index cbb6ac825a..fa31065c61 100644
--- a/epan/dissectors/packet-ziop.c
+++ b/epan/dissectors/packet-ziop.c
@@ -139,7 +139,7 @@ dissect_ziop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data
giop_version_minor);
}
call_dissector(data_handle, tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
col_add_fstr (pinfo->cinfo, COL_INFO, "ZIOP %u.%u %s",
@@ -185,7 +185,7 @@ dissect_ziop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data
proto_tree_add_item(ziop_tree, hf_ziop_original_length, tvb, offset, 4, byte_order);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -218,14 +218,14 @@ dissect_ziop_tcp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void*
if (tvb_get_ntohl(tvb, 0) == GIOP_MAGIC_NUMBER)
{
dissect_giop(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
return 0;
}
tcp_dissect_pdus(tvb, pinfo, tree, ziop_desegment, ZIOP_HEADER_SIZE,
get_ziop_pdu_len, dissect_ziop, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -237,7 +237,7 @@ dissect_ziop_heur (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void
conversation_t *conversation;
/* check magic number and version */
- tot_len = tvb_length(tvb);
+ tot_len = tvb_captured_length(tvb);
if (tot_len < ZIOP_HEADER_SIZE) /* tot_len < 12 */
{