aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packet-afs.c8
-rw-r--r--packet-aim.c4
-rw-r--r--packet-auto_rp.c4
-rw-r--r--packet-bacapp.c4
-rw-r--r--packet-beep.c4
-rw-r--r--packet-bootp.c5
-rw-r--r--packet-cdp.c5
-rw-r--r--packet-cgmp.c6
-rw-r--r--packet-cops.c6
-rw-r--r--packet-cups.c6
-rw-r--r--packet-dcerpc.c6
-rw-r--r--packet-ddtp.c5
-rw-r--r--packet-dhcpv6.c5
-rw-r--r--packet-dlsw.c4
-rw-r--r--packet-dsi.c6
-rw-r--r--packet-eigrp.c8
-rw-r--r--packet-esis.c8
-rw-r--r--packet-frame.c4
-rw-r--r--packet-ftp.c6
-rw-r--r--packet-giop.c36
-rw-r--r--packet-gnutella.c4
-rw-r--r--packet-gtp.c6
-rw-r--r--packet-h261.c4
-rw-r--r--packet-hsrp.c4
-rw-r--r--packet-http.c6
-rw-r--r--packet-icap.c4
-rw-r--r--packet-icmpv6.c27
-rw-r--r--packet-ieee80211.c4
-rw-r--r--packet-igrp.c6
-rw-r--r--packet-imap.c6
-rw-r--r--packet-ipp.c6
-rw-r--r--packet-ipsec.c8
-rw-r--r--packet-ipx.c23
-rw-r--r--packet-irc.c5
-rw-r--r--packet-isis-hello.c5
-rw-r--r--packet-isis-snp.c10
-rw-r--r--packet-isis.c8
-rw-r--r--packet-isup.c4
-rw-r--r--packet-iua.c6
-rw-r--r--packet-klm.c7
-rw-r--r--packet-lapb.c8
-rw-r--r--packet-ldap.c8
-rw-r--r--packet-lpd.c5
-rw-r--r--packet-m2tp.c6
-rw-r--r--packet-m3ua.c6
-rw-r--r--packet-mapi.c17
-rw-r--r--packet-mip.c9
-rw-r--r--packet-mmse.c5
-rw-r--r--packet-mpeg1.c4
-rw-r--r--packet-msdp.c14
-rw-r--r--packet-msproxy.c6
-rw-r--r--packet-ncp.c4
-rw-r--r--packet-ndmp.c6
-rw-r--r--packet-nlm.c18
-rw-r--r--packet-nntp.c6
-rw-r--r--packet-ntp.c5
-rw-r--r--packet-ospf.c14
-rw-r--r--packet-pim.c36
-rw-r--r--packet-pop.c6
-rw-r--r--packet-q2931.c6
-rw-r--r--packet-q931.c6
-rw-r--r--packet-qllc.c6
-rw-r--r--packet-quake.c7
-rw-r--r--packet-quake2.c14
-rw-r--r--packet-quake3.c16
-rw-r--r--packet-quakeworld.c14
-rw-r--r--packet-ranap.c14
-rw-r--r--packet-rip.c4
-rw-r--r--packet-ripng.c5
-rw-r--r--packet-rlogin.c10
-rw-r--r--packet-rquota.c4
-rw-r--r--packet-rsh.c6
-rw-r--r--packet-rtp.c6
-rw-r--r--packet-sap.c8
-rw-r--r--packet-sdp.c5
-rw-r--r--packet-sip.c4
-rw-r--r--packet-slimp3.c21
-rw-r--r--packet-smb-browse.c6
-rw-r--r--packet-smb-common.c11
-rw-r--r--packet-smb-logon.c6
-rw-r--r--packet-smtp.c5
-rw-r--r--packet-snmp.c8
-rw-r--r--packet-socks.c13
-rw-r--r--packet-spray.c4
-rw-r--r--packet-srvloc.c7
-rw-r--r--packet-ssl.c5
-rw-r--r--packet-stat.c4
-rw-r--r--packet-sua.c10
-rw-r--r--packet-syslog.c12
-rw-r--r--packet-tacacs.c6
-rw-r--r--packet-telnet.c5
-rw-r--r--packet-tftp.c13
-rw-r--r--packet-time.c5
-rw-r--r--packet-tns.c59
-rw-r--r--packet-ucp.c5
-rw-r--r--packet-vrrp.c5
-rw-r--r--packet-vtp.c6
-rw-r--r--packet-wccp.c4
-rw-r--r--packet-who.c6
-rw-r--r--packet-wsp.c6
-rw-r--r--packet-wtls.c10
-rw-r--r--packet-x11.c8
-rw-r--r--packet-x25.c13
-rw-r--r--packet-yhoo.c11
-rw-r--r--packet-yppasswd.c4
-rw-r--r--packet-zebra.c9
106 files changed, 404 insertions, 494 deletions
diff --git a/packet-afs.c b/packet-afs.c
index a750204e61..81c49a9e4b 100644
--- a/packet-afs.c
+++ b/packet-afs.c
@@ -8,7 +8,7 @@
* Portions based on information/specs retrieved from the OpenAFS sources at
* www.openafs.org, Copyright IBM.
*
- * $Id: packet-afs.c,v 1.39 2002/01/21 07:36:32 guy Exp $
+ * $Id: packet-afs.c,v 1.40 2002/01/24 09:20:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -357,12 +357,12 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_afs, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_afs, tvb, offset, -1,
+ FALSE);
afs_tree = proto_item_add_subtree(ti, ett_afs);
proto_tree_add_text(afs_tree, tvb,
- offset, tvb_length_remaining(tvb, offset),
+ offset, -1,
"Service: %s%s%s %s",
VALID_OPCODE(opcode) ? "" : "Encrypted ",
typenode == hf_afs_ubik ? "UBIK - " : "",
diff --git a/packet-aim.c b/packet-aim.c
index a58423809a..7e5873b767 100644
--- a/packet-aim.c
+++ b/packet-aim.c
@@ -2,7 +2,7 @@
* Routines for AIM Instant Messenger (OSCAR) dissection
* Copyright 2000, Ralf Hoelzer <ralf@well.com>
*
- * $Id: packet-aim.c,v 1.13 2002/01/21 07:36:32 guy Exp $
+ * $Id: packet-aim.c,v 1.14 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -143,7 +143,7 @@ static void dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
- ti = proto_tree_add_item(tree, proto_aim, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_aim, tvb, 0, -1, FALSE);
aim_tree = proto_item_add_subtree(ti, ett_aim);
proto_tree_add_uint(aim_tree, hf_aim_cmd_start, tvb, 0, 1, '*');
proto_tree_add_uint(aim_tree, hf_aim_channel, tvb, 1, 1, hdr_channel);
diff --git a/packet-auto_rp.c b/packet-auto_rp.c
index 84779b05be..683e214ee7 100644
--- a/packet-auto_rp.c
+++ b/packet-auto_rp.c
@@ -4,7 +4,7 @@
*
* Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-auto_rp.c,v 1.17 2002/01/21 07:36:32 guy Exp $
+ * $Id: packet-auto_rp.c,v 1.18 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -143,7 +143,7 @@ static void dissect_auto_rp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 holdtime;
offset = 0;
- ti = proto_tree_add_item(tree, proto_auto_rp, tvb, offset, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_auto_rp, tvb, offset, -1, FALSE);
auto_rp_tree = proto_item_add_subtree(ti, ett_auto_rp);
tv = proto_tree_add_text(auto_rp_tree, tvb, offset, 1, "Version: %s, Packet type: %s",
diff --git a/packet-bacapp.c b/packet-bacapp.c
index ae2a89a969..7571188e6a 100644
--- a/packet-bacapp.c
+++ b/packet-bacapp.c
@@ -2,7 +2,7 @@
* Routines for BACnet (APDU) dissection
* Copyright 2001, Hartmut Mueller <hartmut@abmlinux.org>, FH Dortmund
*
- * $Id: packet-bacapp.c,v 1.9 2002/01/21 07:36:32 guy Exp $
+ * $Id: packet-bacapp.c,v 1.10 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -92,7 +92,7 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_fstr(pinfo->cinfo, COL_INFO, "(%s)",
bacapp_type_name(bacapp_type));
if (tree) {
- ti = proto_tree_add_item(tree, proto_bacapp, tvb, offset, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_bacapp, tvb, offset, -1, FALSE);
bacapp_tree = proto_item_add_subtree(ti, ett_bacapp);
diff --git a/packet-beep.c b/packet-beep.c
index a5c553f7a7..1cd338ec5f 100644
--- a/packet-beep.c
+++ b/packet-beep.c
@@ -1,7 +1,7 @@
/* packet-beep.c
* Routines for BEEP packet disassembly
*
- * $Id: packet-beep.c,v 1.3 2002/01/21 07:36:32 guy Exp $
+ * $Id: packet-beep.c,v 1.4 2002/01/24 09:20:47 guy Exp $
*
* Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com>
* Modified 2001 Darren New <dnew@invisible.net> for BEEP.
@@ -929,7 +929,7 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) { /* Build the tree info ... */
- ti = proto_tree_add_item(tree, proto_beep, tvb, offset, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_beep, tvb, offset, -1, FALSE);
beep_tree = proto_item_add_subtree(ti, ett_beep);
diff --git a/packet-bootp.c b/packet-bootp.c
index b135689193..659a3351ef 100644
--- a/packet-bootp.c
+++ b/packet-bootp.c
@@ -2,7 +2,7 @@
* Routines for BOOTP/DHCP packet disassembly
* Gilbert Ramirez <gram@alumni.rice.edu>
*
- * $Id: packet-bootp.c,v 1.62 2002/01/21 07:36:32 guy Exp $
+ * $Id: packet-bootp.c,v 1.63 2002/01/24 09:20:47 guy Exp $
*
* The information used comes from:
* RFC 951: Bootstrap Protocol
@@ -1127,8 +1127,7 @@ dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_bootp, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_bootp, tvb, 0, -1, FALSE);
bp_tree = proto_item_add_subtree(ti, ett_bootp);
proto_tree_add_uint(bp_tree, hf_bootp_type, tvb,
diff --git a/packet-cdp.c b/packet-cdp.c
index e5122a2406..af2f7edde5 100644
--- a/packet-cdp.c
+++ b/packet-cdp.c
@@ -2,7 +2,7 @@
* Routines for the disassembly of the "Cisco Discovery Protocol"
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-cdp.c,v 1.43 2002/01/21 07:36:32 guy Exp $
+ * $Id: packet-cdp.c,v 1.44 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -117,8 +117,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Cisco Discovery Protocol");
if (tree){
- ti = proto_tree_add_item(tree, proto_cdp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_cdp, tvb, offset, -1, FALSE);
cdp_tree = proto_item_add_subtree(ti, ett_cdp);
/* CDP header */
diff --git a/packet-cgmp.c b/packet-cgmp.c
index 844501688b..94bc0759ac 100644
--- a/packet-cgmp.c
+++ b/packet-cgmp.c
@@ -1,7 +1,7 @@
/* packet-cgmp.c
* Routines for the disassembly of the Cisco Group Management Protocol
*
- * $Id: packet-cgmp.c,v 1.13 2002/01/21 07:36:32 guy Exp $
+ * $Id: packet-cgmp.c,v 1.14 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -71,8 +71,8 @@ dissect_cgmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Cisco Group Management Protocol");
if (tree) {
- ti = proto_tree_add_item(tree, proto_cgmp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_cgmp, tvb, offset, -1,
+ FALSE);
cgmp_tree = proto_item_add_subtree(ti, ett_cgmp);
proto_tree_add_item(cgmp_tree, hf_cgmp_version, tvb, offset, 1,
diff --git a/packet-cops.c b/packet-cops.c
index 8f0d948dfc..740fd67e53 100644
--- a/packet-cops.c
+++ b/packet-cops.c
@@ -4,7 +4,7 @@
*
* Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-cops.c,v 1.16 2002/01/21 07:36:33 guy Exp $
+ * $Id: packet-cops.c,v 1.17 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -283,7 +283,7 @@ static void dissect_cops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint garbage;
offset = 0;
- ti = proto_tree_add_item(tree, proto_cops, tvb, offset, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_cops, tvb, offset, -1, FALSE);
cops_tree = proto_item_add_subtree(ti, ett_cops);
/* Version and flags share the same byte, put them in a subtree */
@@ -392,7 +392,7 @@ static int dissect_cops_object(tvbuff_t *tvb, guint32 offset, proto_tree *tree)
char *type_str;
int ret;
- if (tvb_length_remaining(tvb, offset) < COPS_OBJECT_HDR_SIZE)
+ if (tvb_reported_length_remaining(tvb, offset) < COPS_OBJECT_HDR_SIZE)
return 0;
object_len = tvb_get_ntohs(tvb, offset);
diff --git a/packet-cups.c b/packet-cups.c
index 2706c4bb0b..20f1c4f067 100644
--- a/packet-cups.c
+++ b/packet-cups.c
@@ -5,7 +5,7 @@
* Charles Levert <charles@comm.polymtl.ca>
* Copyright 2001 Charles Levert
*
-* $Id: packet-cups.c,v 1.9 2002/01/21 07:36:33 guy Exp $
+* $Id: packet-cups.c,v 1.10 2002/01/24 09:20:47 guy Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -170,8 +170,8 @@ dissect_cups(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
if (tree) {
- ti = proto_tree_add_item(tree, proto_cups, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_cups, tvb, offset, -1,
+ FALSE);
cups_tree = proto_item_add_subtree(ti, ett_cups);
}
diff --git a/packet-dcerpc.c b/packet-dcerpc.c
index e5d4d41aa7..9ca8fec673 100644
--- a/packet-dcerpc.c
+++ b/packet-dcerpc.c
@@ -2,7 +2,7 @@
* Routines for DCERPC packet disassembly
* Copyright 2001, Todd Sabin <tas@webspan.net>
*
- * $Id: packet-dcerpc.c,v 1.25 2002/01/23 05:37:38 guy Exp $
+ * $Id: packet-dcerpc.c,v 1.26 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -461,7 +461,7 @@ dcerpc_try_handoff (packet_info *pinfo, proto_tree *tree,
if (tree) {
proto_item *sub_item;
sub_item = proto_tree_add_item (tree, sub_proto->proto, tvb, offset,
- tvb_length (tvb) - offset, FALSE);
+ -1, FALSE);
if (sub_item) {
sub_tree = proto_item_add_subtree (sub_item, sub_proto->ett);
@@ -1301,7 +1301,7 @@ dissect_dcerpc_dg (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hdr.serial_lo = tvb_get_guint8 (tvb, offset++);
if (tree) {
- ti = proto_tree_add_item (tree, proto_dcerpc, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item (tree, proto_dcerpc, tvb, 0, -1, FALSE);
if (ti) {
dcerpc_tree = proto_item_add_subtree(ti, ett_dcerpc);
}
diff --git a/packet-ddtp.c b/packet-ddtp.c
index 2818faea53..2b9bc81316 100644
--- a/packet-ddtp.c
+++ b/packet-ddtp.c
@@ -3,7 +3,7 @@
* see http://ddt.sourceforge.net/
* Olivier Abad <oabad@cybercable.fr>
*
- * $Id: packet-ddtp.c,v 1.19 2002/01/21 07:36:33 guy Exp $
+ * $Id: packet-ddtp.c,v 1.20 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -110,8 +110,7 @@ dissect_ddtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear (pinfo->cinfo, COL_INFO);
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_ddtp, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ddtp, tvb, 0, -1, FALSE);
ddtp_tree = proto_item_add_subtree(ti, ett_ddtp);
proto_tree_add_item(ddtp_tree, hf_ddtp_version, tvb, 0, 4, FALSE);
diff --git a/packet-dhcpv6.c b/packet-dhcpv6.c
index e5a5dacea1..5ec89c6338 100644
--- a/packet-dhcpv6.c
+++ b/packet-dhcpv6.c
@@ -2,7 +2,7 @@
* Routines for DHCPv6 packet disassembly
* Jun-ichiro itojun Hagino <itojun@iijlab.net>
*
- * $Id: packet-dhcpv6.c,v 1.3 2002/01/21 07:36:33 guy Exp $
+ * $Id: packet-dhcpv6.c,v 1.4 2002/01/24 09:20:47 guy Exp $
*
* The information used comes from:
* draft-ietf-dhc-dhcpv6-22.txt
@@ -203,8 +203,7 @@ dissect_dhcpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_dhcpv6, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_dhcpv6, tvb, 0, -1, FALSE);
bp_tree = proto_item_add_subtree(ti, ett_dhcpv6);
proto_tree_add_uint(bp_tree, hf_dhcpv6_msgtype, tvb, 0, 1,
diff --git a/packet-dlsw.c b/packet-dlsw.c
index aba9d697a7..82210e7736 100644
--- a/packet-dlsw.c
+++ b/packet-dlsw.c
@@ -2,7 +2,7 @@
* Routines for DLSw packet dissection (Data Link Switching)
* Copyright 2001, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-dlsw.c,v 1.3 2002/01/21 07:36:33 guy Exp $
+ * $Id: packet-dlsw.c,v 1.4 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -218,7 +218,7 @@ dissect_dlsw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
- ti = proto_tree_add_item(tree, proto_dlsw, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_dlsw, tvb, 0, -1, FALSE);
dlsw_tree = proto_item_add_subtree(ti, ett_dlsw);
hlen=tvb_get_guint8(tvb,1);
diff --git a/packet-dsi.c b/packet-dsi.c
index b24e0e9ce5..3820abd09f 100644
--- a/packet-dsi.c
+++ b/packet-dsi.c
@@ -2,7 +2,7 @@
* Routines for dsi packet dissection
* Copyright 2001, Randy McEoin <rmceoin@pe.com>
*
- * $Id: packet-dsi.c,v 1.8 2002/01/21 07:36:34 guy Exp $
+ * $Id: packet-dsi.c,v 1.9 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -378,8 +378,8 @@ dissect_dsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
- ti = proto_tree_add_item(tree, proto_dsi, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_dsi, tvb, offset, -1,
+ FALSE);
dsi_tree = proto_item_add_subtree(ti, ett_dsi);
if (prev_cont == TRUE)
diff --git a/packet-eigrp.c b/packet-eigrp.c
index a5d666ce15..5a7fd7644d 100644
--- a/packet-eigrp.c
+++ b/packet-eigrp.c
@@ -2,7 +2,7 @@
* Routines for EIGRP dissection
* Copyright 2000, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-eigrp.c,v 1.20 2002/01/21 07:36:34 guy Exp $
+ * $Id: packet-eigrp.c,v 1.21 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -166,8 +166,8 @@ dissect_eigrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
if (tree) {
- ti = proto_tree_add_protocol_format(tree, proto_eigrp, tvb, 0,
- tvb_length(tvb), "Cisco EIGRP ");
+ ti = proto_tree_add_protocol_format(tree, proto_eigrp, tvb, 0, -1,
+ "Cisco EIGRP");
eigrp_tree = proto_item_add_subtree(ti, ett_eigrp);
@@ -185,7 +185,7 @@ dissect_eigrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
return;
}
- while ( tvb_length_remaining(tvb,offset)>0 ) {
+ while ( tvb_reported_length_remaining(tvb,offset)>0 ) {
tlv = tvb_get_ntohs(tvb,offset);
size = tvb_get_ntohs(tvb,offset+2);
diff --git a/packet-esis.c b/packet-esis.c
index 9a5c5a6390..3aa0847c47 100644
--- a/packet-esis.c
+++ b/packet-esis.c
@@ -2,7 +2,7 @@
* Routines for ISO/OSI End System to Intermediate System
* Routing Exchange Protocol ISO 9542.
*
- * $Id: packet-esis.c,v 1.21 2002/01/24 07:24:56 guy Exp $
+ * $Id: packet-esis.c,v 1.22 2002/01/24 09:20:47 guy Exp $
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
* Ethereal - Network traffic analyzer
@@ -149,7 +149,7 @@ esis_dissect_unknown( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
va_list ap;
va_start(ap, fmat);
- proto_tree_add_text_valist(tree, tvb, 0, tvb_length(tvb), fmat, ap);
+ proto_tree_add_text_valist(tree, tvb, 0, -1, fmat, ap);
va_end(ap);
}
@@ -170,7 +170,7 @@ esis_dissect_esh_pdu( u_char len, tvbuff_t *tvb, packet_info *pinfo,
no_sa = tvb_get_guint8(tvb, offset);
len -= 1;
- ti = proto_tree_add_text( tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ ti = proto_tree_add_text( tree, tvb, offset, -1,
"Number of Source Addresses (SA, Format: NSAP) : %u", no_sa );
offset++;
@@ -299,7 +299,7 @@ dissect_esis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
tvb_memcpy(tvb, (guint8 *)&ehdr, 0, sizeof ehdr);
if (tree) {
- ti = proto_tree_add_item(tree, proto_esis, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_esis, tvb, 0, -1, FALSE);
esis_tree = proto_item_add_subtree(ti, ett_esis);
if (ehdr.esis_version != ESIS_REQUIRED_VERSION){
diff --git a/packet-frame.c b/packet-frame.c
index 4593e84177..f11586b59d 100644
--- a/packet-frame.c
+++ b/packet-frame.c
@@ -2,7 +2,7 @@
*
* Top-most dissector. Decides dissector based on Wiretap Encapsulation Type.
*
- * $Id: packet-frame.c,v 1.20 2002/01/21 07:36:34 guy Exp $
+ * $Id: packet-frame.c,v 1.21 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -90,7 +90,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
cap_len = tvb_length(tvb);
pkt_len = tvb_reported_length(tvb);
- ti = proto_tree_add_protocol_format(tree, proto_frame, tvb, 0, tvb_length(tvb),
+ ti = proto_tree_add_protocol_format(tree, proto_frame, tvb, 0, -1,
"Frame %u (%u on wire, %u captured)", pinfo->fd->num, pkt_len, cap_len);
fh_tree = proto_item_add_subtree(ti, ett_frame);
diff --git a/packet-ftp.c b/packet-ftp.c
index 89dada09b7..e2ce6ba790 100644
--- a/packet-ftp.c
+++ b/packet-ftp.c
@@ -3,7 +3,7 @@
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
* Copyright 2001, Juan Toledo <toledo@users.sourceforge.net> (Passive FTP)
*
- * $Id: packet-ftp.c,v 1.40 2002/01/21 07:36:34 guy Exp $
+ * $Id: packet-ftp.c,v 1.41 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -249,8 +249,8 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_ftp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_ftp, tvb, offset, -1,
+ FALSE);
ftp_tree = proto_item_add_subtree(ti, ett_ftp);
if (is_request) {
diff --git a/packet-giop.c b/packet-giop.c
index ab7f7ee151..bd50b39fcd 100644
--- a/packet-giop.c
+++ b/packet-giop.c
@@ -9,7 +9,7 @@
* Frank Singleton <frank.singleton@ericsson.com>
* Trevor Shepherd <eustrsd@am1.ericsson.se>
*
- * $Id: packet-giop.c,v 1.54 2002/01/21 07:36:34 guy Exp $
+ * $Id: packet-giop.c,v 1.55 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -3082,8 +3082,7 @@ static void dissect_giop_reply (tvbuff_t * tvb, packet_info * pinfo, proto_tree
guint32 mfn; /* matching frame number */
if (tree) {
- tf = proto_tree_add_text (tree, tvb, offset,
- tvb_length (tvb),
+ tf = proto_tree_add_text (tree, tvb, offset, -1,
"General Inter-ORB Protocol Reply");
if (reply_tree == NULL)
{
@@ -3168,8 +3167,7 @@ static void dissect_giop_reply_1_2 (tvbuff_t * tvb, packet_info * pinfo,
guint32 mfn; /* matching frame number */
if (tree) {
- tf = proto_tree_add_text (tree, tvb, offset,
- tvb_length (tvb),
+ tf = proto_tree_add_text (tree, tvb, offset, -1,
"General Inter-ORB Protocol Reply");
reply_tree = proto_item_add_subtree (tf, ett_giop_reply);
}
@@ -3247,8 +3245,7 @@ static void dissect_giop_cancel_request (tvbuff_t * tvb, packet_info * pinfo,
proto_item *tf;
if (tree) {
- tf = proto_tree_add_text (tree, tvb, offset,
- tvb_length (tvb),
+ tf = proto_tree_add_text (tree, tvb, offset, -1,
"General Inter-ORB Protocol CancelRequest");
cancel_request_tree = proto_item_add_subtree (tf, ett_giop_cancel_request);
}
@@ -3307,8 +3304,7 @@ dissect_giop_request_1_1 (tvbuff_t * tvb, packet_info * pinfo,
if (tree)
{
- tf = proto_tree_add_text (tree, tvb, offset,
- tvb_length (tvb),
+ tf = proto_tree_add_text (tree, tvb, offset, -1,
"General Inter-ORB Protocol Request");
if (request_tree == NULL)
{
@@ -3531,8 +3527,7 @@ dissect_giop_request_1_2 (tvbuff_t * tvb, packet_info * pinfo,
if (tree)
{
- tf = proto_tree_add_text (tree, tvb, offset,
- tvb_length (tvb),
+ tf = proto_tree_add_text (tree, tvb, offset, -1,
"General Inter-ORB Protocol Request");
request_tree = proto_item_add_subtree (tf, ett_giop_reply);
}
@@ -3661,8 +3656,7 @@ dissect_giop_locate_request( tvbuff_t * tvb, packet_info * pinfo,
if (tree)
{
- tf = proto_tree_add_text (tree, tvb, offset,
- tvb_length (tvb),
+ tf = proto_tree_add_text (tree, tvb, offset, -1,
"General Inter-ORB Locate Request");
if (locate_request_tree == NULL)
{
@@ -3730,8 +3724,7 @@ dissect_giop_locate_reply( tvbuff_t * tvb, packet_info * pinfo,
if (tree)
{
- tf = proto_tree_add_text (tree, tvb, offset,
- tvb_length (tvb),
+ tf = proto_tree_add_text (tree, tvb, offset, -1,
"General Inter-ORB Locate Reply");
if (locate_reply_tree == NULL)
{
@@ -3804,8 +3797,7 @@ dissect_giop_fragment( tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
if (tree)
{
- tf = proto_tree_add_text (tree, tvb, offset,
- tvb_length (tvb),
+ tf = proto_tree_add_text (tree, tvb, offset, -1,
"General Inter-ORB Fragment");
if (fragment_tree == NULL)
{
@@ -3907,11 +3899,9 @@ gboolean dissect_giop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) {
}
if (tree)
{
- ti = proto_tree_add_item (tree, proto_giop, tvb, 0,
- tvb_length (tvb), FALSE);
+ ti = proto_tree_add_item (tree, proto_giop, tvb, 0, -1, FALSE);
clnp_tree = proto_item_add_subtree (ti, ett_giop);
- proto_tree_add_text (clnp_tree, giop_header_tvb, 0,
- tvb_length (giop_header_tvb),
+ proto_tree_add_text (clnp_tree, giop_header_tvb, 0, -1,
"Version %u.%u not supported",
header.GIOP_version.major,
header.GIOP_version.minor);
@@ -4373,7 +4363,7 @@ void decode_IOR(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offse
/* create a subtree */
if (ptree) {
- tf = proto_tree_add_text (ptree, tvb, *offset, tvb_length (tvb), "IOR");
+ tf = proto_tree_add_text (ptree, tvb, *offset, -1, "IOR");
tree = proto_item_add_subtree (tf, ett_giop_ior);
}
@@ -4750,7 +4740,7 @@ void decode_ServiceContextList(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pt
/* create a subtree */
if (ptree) {
- tf = proto_tree_add_text (ptree, tvb, *offset, tvb_length (tvb), "ServiceContextList");
+ tf = proto_tree_add_text (ptree, tvb, *offset, -1, "ServiceContextList");
tree = proto_item_add_subtree (tf, ett_giop_scl);
}
diff --git a/packet-gnutella.c b/packet-gnutella.c
index 5c99dab154..c10807c1ad 100644
--- a/packet-gnutella.c
+++ b/packet-gnutella.c
@@ -2,7 +2,7 @@
* Routines for gnutella dissection
* Copyright 2001, B. Johannessen <bob@havoq.com>
*
- * $Id: packet-gnutella.c,v 1.11 2002/01/21 07:36:34 guy Exp $
+ * $Id: packet-gnutella.c,v 1.12 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -405,7 +405,7 @@ static void dissect_gnutella(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_gnutella,
tvb,
0,
- tvb_length(tvb),
+ -1,
FALSE);
gnutella_tree = proto_item_add_subtree(ti, ett_gnutella);
diff --git a/packet-gtp.c b/packet-gtp.c
index 8fb4a9cd21..315df962fd 100644
--- a/packet-gtp.c
+++ b/packet-gtp.c
@@ -4,7 +4,7 @@
* Copyright 2001, Michal Melerowicz <michal.melerowicz@nokia.com>
* Nicolas Balkota <balkota@mac.com>
*
- * $Id: packet-gtp.c,v 1.20 2002/01/21 07:36:34 guy Exp $
+ * $Id: packet-gtp.c,v 1.21 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -4722,7 +4722,7 @@ dissect_gtpv0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
/* dissect GTP header */
- ti = proto_tree_add_item(tree, proto_gtpv0, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_gtpv0, tvb, 0, -1, FALSE);
gtpv0_tree = proto_item_add_subtree(ti, ett_gtp);
tf = proto_tree_add_uint(gtpv0_tree, hf_gtpv0_flags, tvb, 0, 1, gtpv0_hdr.flags);
@@ -4812,7 +4812,7 @@ dissect_gtpv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
if (tree) {
- ti = proto_tree_add_item(tree, proto_gtpv1, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_gtpv1, tvb, 0, -1, FALSE);
gtpv1_tree = proto_item_add_subtree(ti, ett_gtp);
tf = proto_tree_add_uint(gtpv1_tree, hf_gtpv1_flags, tvb, 0, 1, gtpv1_hdr.flags);
diff --git a/packet-h261.c b/packet-h261.c
index 39d7f984de..125bc123f9 100644
--- a/packet-h261.c
+++ b/packet-h261.c
@@ -2,7 +2,7 @@
*
* Routines for ITU-T Recommendation H.261 dissection
*
- * $Id: packet-h261.c,v 1.11 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-h261.c,v 1.12 2002/01/24 09:20:48 guy Exp $
*
* Copyright 2000, Philips Electronics N.V.
* Andreas Sikkema <andreas.sikkema@philips.com>
@@ -84,7 +84,7 @@ dissect_h261( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
}
if ( tree ) {
- ti = proto_tree_add_item( tree, proto_h261, tvb, offset, tvb_length( tvb ), FALSE );
+ ti = proto_tree_add_item( tree, proto_h261, tvb, offset, -1, FALSE );
h261_tree = proto_item_add_subtree( ti, ett_h261 );
/* SBIT 1st octet, 3 bits */
proto_tree_add_uint( h261_tree, hf_h261_sbit, tvb, offset, 1, tvb_get_guint8( tvb, offset ) >> 5 );
diff --git a/packet-hsrp.c b/packet-hsrp.c
index 98b2180766..6b6976cdc8 100644
--- a/packet-hsrp.c
+++ b/packet-hsrp.c
@@ -4,7 +4,7 @@
*
* Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-hsrp.c,v 1.21 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-hsrp.c,v 1.22 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -128,7 +128,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 auth_buf[8 + 1];
offset = 0;
- ti = proto_tree_add_item(tree, proto_hsrp, tvb, offset, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_hsrp, tvb, offset, -1, FALSE);
hsrp_tree = proto_item_add_subtree(ti, ett_hsrp);
proto_tree_add_item(hsrp_tree, hf_hsrp_version, tvb, offset, 1, FALSE);
diff --git a/packet-http.c b/packet-http.c
index b11e3dc8f5..721a6ecfcc 100644
--- a/packet-http.c
+++ b/packet-http.c
@@ -3,7 +3,7 @@
*
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-http.c,v 1.45 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-http.c,v 1.46 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -135,8 +135,8 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_http, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_http, tvb, offset, -1,
+ FALSE);
http_tree = proto_item_add_subtree(ti, ett_http);
}
diff --git a/packet-icap.c b/packet-icap.c
index 766c751d5f..fec2d35056 100644
--- a/packet-icap.c
+++ b/packet-icap.c
@@ -99,8 +99,8 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_icap, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_icap, tvb, offset, -1,
+ FALSE);
icap_tree = proto_item_add_subtree(ti, ett_icap);
}
diff --git a/packet-icmpv6.c b/packet-icmpv6.c
index e1d8dc1b34..3a6b30331b 100644
--- a/packet-icmpv6.c
+++ b/packet-icmpv6.c
@@ -1,7 +1,7 @@
/* packet-icmpv6.c
* Routines for ICMPv6 packet disassembly
*
- * $Id: packet-icmpv6.c,v 1.63 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-icmpv6.c,v 1.64 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -659,10 +659,10 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
if (ni->ni_type == ICMP6_NI_QUERY) {
switch (ni->ni_code) {
case ICMP6_NI_SUBJ_IPV6:
- n = tvb_length_remaining(tvb, offset + sizeof(*ni));
+ n = tvb_reported_length_remaining(tvb, offset + sizeof(*ni));
n /= sizeof(struct e_in6_addr);
tf = proto_tree_add_text(tree, tvb,
- offset + sizeof(*ni), tvb_length_remaining(tvb, offset), "IPv6 subject addresses");
+ offset + sizeof(*ni), -1, "IPv6 subject addresses");
field_tree = proto_item_add_subtree(tf, ett_nodeinfo_subject6);
p = offset + sizeof *ni;
for (i = 0; i < n; i++) {
@@ -690,10 +690,10 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
off = tvb_length_remaining(tvb, offset + sizeof(*ni) + l);
break;
case ICMP6_NI_SUBJ_IPV4:
- n = tvb_length_remaining(tvb, offset + sizeof(*ni));
+ n = tvb_reported_length_remaining(tvb, offset + sizeof(*ni));
n /= sizeof(guint32);
tf = proto_tree_add_text(tree, tvb,
- offset + sizeof(*ni), tvb_length_remaining(tvb, offset), "IPv4 subject addresses");
+ offset + sizeof(*ni), -1, "IPv4 subject addresses");
field_tree = proto_item_add_subtree(tf, ett_nodeinfo_subject4);
p = offset + sizeof *ni;
for (i = 0; i < n; i++) {
@@ -712,7 +712,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
case NI_QTYPE_SUPTYPES:
p = offset + sizeof *ni;
tf = proto_tree_add_text(tree, tvb,
- offset + sizeof(*ni), tvb_length_remaining(tvb, p),
+ offset + sizeof(*ni), -1,
"Supported type bitmap%s",
(flags & 0x0001) ? ", compressed" : "");
field_tree = proto_item_add_subtree(tf,
@@ -720,7 +720,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
n = 0;
while (tvb_bytes_exist(tvb, p, sizeof(guint32))) { /* XXXX Check what? */
if ((flags & 0x0001) == 0) {
- l = tvb_length_remaining(tvb, offset + sizeof(*ni));
+ l = tvb_reported_length_remaining(tvb, offset + sizeof(*ni));
l /= sizeof(guint32);
i = 0;
} else {
@@ -750,12 +750,11 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
proto_tree_add_text(tree, tvb, offset + sizeof(*ni),
sizeof(gint32), "TTL: %d", (gint32)tvb_get_ntohl(tvb, offset + sizeof *ni));
tf = proto_tree_add_text(tree, tvb,
- offset + sizeof(*ni) + sizeof(guint32),
- tvb_length_remaining(tvb, offset),
+ offset + sizeof(*ni) + sizeof(guint32), -1,
"DNS labels");
field_tree = proto_item_add_subtree(tf, ett_nodeinfo_nodedns);
j = offset + sizeof (*ni) + sizeof(guint32);
- while (j < tvb_length(tvb)) {
+ while (j < tvb_reported_length(tvb)) {
l = get_dns_name(tvb, j,
offset + sizeof (*ni) + sizeof(guint32),
dname,sizeof(dname));
@@ -773,10 +772,10 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
off = tvb_length_remaining(tvb, offset);
break;
case NI_QTYPE_NODEADDR:
- n = tvb_length_remaining(tvb, offset + sizeof(*ni));
+ n = tvb_reported_length_remaining(tvb, offset + sizeof(*ni));
n /= sizeof(gint32) + sizeof(struct e_in6_addr);
tf = proto_tree_add_text(tree, tvb,
- offset + sizeof(*ni), tvb_length_remaining(tvb, offset), "IPv6 node addresses");
+ offset + sizeof(*ni), -1, "IPv6 node addresses");
field_tree = proto_item_add_subtree(tf, ett_nodeinfo_node6);
p = offset + sizeof (*ni);
for (i = 0; i < n; i++) {
@@ -792,10 +791,10 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
off = tvb_length_remaining(tvb, offset);
break;
case NI_QTYPE_IPV4ADDR:
- n = tvb_length_remaining(tvb, offset + sizeof(*ni));
+ n = tvb_reported_length_remaining(tvb, offset + sizeof(*ni));
n /= sizeof(gint32) + sizeof(guint32);
tf = proto_tree_add_text(tree, tvb,
- offset + sizeof(*ni), tvb_length_remaining(tvb, offset), "IPv4 node addresses");
+ offset + sizeof(*ni), -1, "IPv4 node addresses");
field_tree = proto_item_add_subtree(tf, ett_nodeinfo_node4);
p = offset + sizeof *ni;
for (i = 0; i < n; i++) {
diff --git a/packet-ieee80211.c b/packet-ieee80211.c
index f55e67e84b..c579c57c96 100644
--- a/packet-ieee80211.c
+++ b/packet-ieee80211.c
@@ -3,7 +3,7 @@
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
- * $Id: packet-ieee80211.c,v 1.47 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-ieee80211.c,v 1.48 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -816,7 +816,7 @@ dissect_ieee80211_mgt (guint16 fcf, tvbuff_t * tvb, packet_info * pinfo,
if (tree)
{
- ti = proto_tree_add_item (tree, proto_wlan_mgt, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item (tree, proto_wlan_mgt, tvb, 0, -1, FALSE);
mgt_tree = proto_item_add_subtree (ti, ett_80211_mgt);
switch (COMPOSE_FRAME_TYPE(fcf))
diff --git a/packet-igrp.c b/packet-igrp.c
index edadfd79f3..bdde487766 100644
--- a/packet-igrp.c
+++ b/packet-igrp.c
@@ -2,7 +2,7 @@
* Routines for IGRP dissection
* Copyright 2000, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-igrp.c,v 1.11 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-igrp.c,v 1.12 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -87,8 +87,8 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
- ti = proto_tree_add_protocol_format(tree, proto_igrp, tvb, 0,
- tvb_length(tvb), "Cisco IGRP ");
+ ti = proto_tree_add_protocol_format(tree, proto_igrp, tvb, 0, -1,
+ "Cisco IGRP");
igrp_tree = proto_item_add_subtree(ti, ett_igrp);
diff --git a/packet-imap.c b/packet-imap.c
index 42b6434145..b1d7d2be53 100644
--- a/packet-imap.c
+++ b/packet-imap.c
@@ -2,7 +2,7 @@
* Routines for imap packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-imap.c,v 1.18 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-imap.c,v 1.19 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -93,8 +93,8 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_imap, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_imap, tvb, offset, -1,
+ FALSE);
imap_tree = proto_item_add_subtree(ti, ett_imap);
if (is_request) {
diff --git a/packet-ipp.c b/packet-ipp.c
index ec80820a86..e899de64e1 100644
--- a/packet-ipp.c
+++ b/packet-ipp.c
@@ -3,7 +3,7 @@
*
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-ipp.c,v 1.28 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-ipp.c,v 1.29 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -178,8 +178,8 @@ dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_ipp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_ipp, tvb, offset, -1,
+ FALSE);
ipp_tree = proto_item_add_subtree(ti, ett_ipp);
proto_tree_add_text(ipp_tree, tvb, offset, 2, "Version: %u.%u",
diff --git a/packet-ipsec.c b/packet-ipsec.c
index 870bc528a7..9eadd4f3ce 100644
--- a/packet-ipsec.c
+++ b/packet-ipsec.c
@@ -1,7 +1,7 @@
/* packet-ipsec.c
* Routines for IPsec/IPComp packet disassembly
*
- * $Id: packet-ipsec.c,v 1.37 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-ipsec.c,v 1.38 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -221,8 +221,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* (ie none)
*/
if(tree) {
- ti = proto_tree_add_item(tree, proto_esp, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_esp, tvb, 0, -1, FALSE);
esp_tree = proto_item_add_subtree(ti, ett_esp);
proto_tree_add_uint(esp_tree, hf_esp_spi, tvb,
offsetof(struct newesp, esp_spi), 4,
@@ -267,8 +266,7 @@ dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* (ie none)
*/
if (tree) {
- ti = proto_tree_add_item(tree, proto_ipcomp, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ipcomp, tvb, 0, -1, FALSE);
ipcomp_tree = proto_item_add_subtree(ti, ett_ipcomp);
proto_tree_add_text(ipcomp_tree, tvb,
diff --git a/packet-ipx.c b/packet-ipx.c
index ae25a81b63..309244652d 100644
--- a/packet-ipx.c
+++ b/packet-ipx.c
@@ -2,7 +2,7 @@
* Routines for NetWare's IPX
* Gilbert Ramirez <gram@alumni.rice.edu>
*
- * $Id: packet-ipx.c,v 1.100 2002/01/21 23:35:31 guy Exp $
+ * $Id: packet-ipx.c,v 1.101 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -394,7 +394,7 @@ dissect_ipxmsg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_ipxmsg, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ipxmsg, tvb, 0, -1, FALSE);
msg_tree = proto_item_add_subtree(ti, ett_ipxmsg);
proto_tree_add_uint(msg_tree, hf_msg_conn, tvb, 0, 1, conn_number);
@@ -431,7 +431,7 @@ dissect_ipxrip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_ipxrip, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ipxrip, tvb, 0, -1, FALSE);
rip_tree = proto_item_add_subtree(ti, ett_ipxrip);
if (operation < 2) {
@@ -453,9 +453,9 @@ dissect_ipxrip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(rip_tree, tvb, 0, 2, "Unknown RIP packet type");
}
- available_length = tvb_length(tvb);
+ available_length = tvb_reported_length(tvb);
for (cursor = 2; cursor < available_length; cursor += 8) {
- memcpy(&route.network, tvb_get_ptr(tvb, cursor, 4), 4);
+ tvb_memcpy(tvb, (guint8 *)&route.network, cursor, 4);
route.hops = tvb_get_ntohs(tvb, cursor+4);
route.ticks = tvb_get_ntohs(tvb, cursor+6);
@@ -762,7 +762,7 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_sap, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_sap, tvb, 0, -1, FALSE);
sap_tree = proto_item_add_subtree(ti, ett_ipxsap);
if (query.query_type >= 1 && query.query_type <= 4) {
@@ -785,12 +785,15 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (query.query_type == IPX_SAP_GENERAL_RESPONSE ||
query.query_type == IPX_SAP_NEAREST_RESPONSE) { /* responses */
- int available_length = tvb_length(tvb);
+ int available_length = tvb_reported_length(tvb);
for (cursor = 2; (cursor + 64) <= available_length; cursor += 64) {
server.server_type = tvb_get_ntohs(tvb, cursor);
- memcpy(server.server_name, tvb_get_ptr(tvb, cursor+2, 48), 48);
- memcpy(&server.server_network, tvb_get_ptr(tvb, cursor+50, 4), 4);
- memcpy(&server.server_node, tvb_get_ptr(tvb, cursor+54, 6), 6);
+ tvb_memcpy(tvb, (guint8 *)server.server_name,
+ cursor+2, 48);
+ tvb_memcpy(tvb, (guint8 *)&server.server_network,
+ cursor+50, 4);
+ tvb_memcpy(tvb, (guint8 *)&server.server_node,
+ cursor+54, 6);
server.server_port = tvb_get_ntohs(tvb, cursor+60);
server.intermediate_network = tvb_get_ntohs(tvb, cursor+62);
diff --git a/packet-irc.c b/packet-irc.c
index c9c92c5885..80a5d745ac 100644
--- a/packet-irc.c
+++ b/packet-irc.c
@@ -1,7 +1,7 @@
/* packet-irc.c
* Routines for IRC packet dissection
*
- * $Id: packet-irc.c,v 1.17 2002/01/21 07:36:35 guy Exp $
+ * $Id: packet-irc.c,v 1.18 2002/01/24 09:20:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -92,8 +92,7 @@ dissect_irc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
- ti = proto_tree_add_item(tree, proto_irc, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_irc, tvb, 0, -1, FALSE);
irc_tree = proto_item_add_subtree(ti, ett_irc);
/*
diff --git a/packet-isis-hello.c b/packet-isis-hello.c
index 882164b235..e0e5d5e5d5 100644
--- a/packet-isis-hello.c
+++ b/packet-isis-hello.c
@@ -1,7 +1,7 @@
/* packet-isis-hello.c
* Routines for decoding isis hello packets and their CLVs
*
- * $Id: packet-isis-hello.c,v 1.25 2002/01/21 07:36:36 guy Exp $
+ * $Id: packet-isis-hello.c,v 1.26 2002/01/24 09:20:49 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@@ -615,8 +615,7 @@ isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
const guint8 *lan_id;
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "ISIS HELLO");
+ ti = proto_tree_add_text(tree, tvb, offset, -1, "ISIS HELLO");
hello_tree = proto_item_add_subtree(ti, ett_isis_hello);
octet = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format(hello_tree,
diff --git a/packet-isis-snp.c b/packet-isis-snp.c
index 1f96364960..efe03175dc 100644
--- a/packet-isis-snp.c
+++ b/packet-isis-snp.c
@@ -1,7 +1,7 @@
/* packet-isis-snp.c
* Routines for decoding isis complete & partial SNP and their payload
*
- * $Id: packet-isis-snp.c,v 1.13 2002/01/21 07:36:36 guy Exp $
+ * $Id: packet-isis-snp.c,v 1.14 2002/01/24 09:20:49 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@@ -248,8 +248,8 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int len;
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset), PROTO_STRING_CSNP);
+ ti = proto_tree_add_text(tree, tvb, offset, -1,
+ PROTO_STRING_CSNP);
csnp_tree = proto_item_add_subtree(ti, ett_isis_csnp);
}
@@ -324,8 +324,8 @@ isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int len;
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset), PROTO_STRING_PSNP);
+ ti = proto_tree_add_text(tree, tvb, offset, -1,
+ PROTO_STRING_PSNP);
psnp_tree = proto_item_add_subtree(ti, ett_isis_psnp);
}
diff --git a/packet-isis.c b/packet-isis.c
index ed2236a24c..3416b34b22 100644
--- a/packet-isis.c
+++ b/packet-isis.c
@@ -2,7 +2,7 @@
* Routines for ISO/OSI network and transport protocol packet disassembly, core
* bits.
*
- * $Id: packet-isis.c,v 1.29 2002/01/21 07:36:36 guy Exp $
+ * $Id: packet-isis.c,v 1.30 2002/01/24 09:20:49 guy Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@@ -95,8 +95,7 @@ isis_dissect_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
va_list ap;
va_start(ap, fmat);
- proto_tree_add_text_valist(tree, tvb, offset,
- tvb_length_remaining(tvb, offset), fmat, ap);
+ proto_tree_add_text_valist(tree, tvb, offset, -1, fmat, ap);
va_end(ap);
}
@@ -147,8 +146,7 @@ dissect_isis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
isis_header_length = tvb_get_guint8(tvb, 1);
if (tree) {
- ti = proto_tree_add_item(tree, proto_isis, tvb, 0,
- tvb_length(tvb), FALSE );
+ ti = proto_tree_add_item(tree, proto_isis, tvb, 0, -1, FALSE);
isis_tree = proto_item_add_subtree(ti, ett_isis);
}
diff --git a/packet-isup.c b/packet-isup.c
index 58de47bd70..a6b9410c5b 100644
--- a/packet-isup.c
+++ b/packet-isup.c
@@ -2,7 +2,7 @@
* Routines for ISUP dissection
* Copyright 2001, Martina Obermeier <martina.obermeier@icn.siemens.de>
*
- * $Id: packet-isup.c,v 1.8 2002/01/21 07:36:36 guy Exp $
+ * $Id: packet-isup.c,v 1.9 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -3917,7 +3917,7 @@ dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
if (tree) {
- ti = proto_tree_add_item(tree, proto_isup, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_isup, tvb, 0, -1, FALSE);
isup_tree = proto_item_add_subtree(ti, ett_isup);
/* dissect CIC in main dissector since pass-along message type carrying complete IUSP message w/o CIC needs
diff --git a/packet-iua.c b/packet-iua.c
index a3bb930e64..ec3f65531f 100644
--- a/packet-iua.c
+++ b/packet-iua.c
@@ -8,7 +8,7 @@
*
* Copyright 2000, Michael Txen <Michael.Tuexen@icn.siemens.de>
*
- * $Id: packet-iua.c,v 1.12 2002/01/21 23:35:32 guy Exp $
+ * $Id: packet-iua.c,v 1.13 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -824,7 +824,7 @@ dissect_iua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *iua_t
if (iua_tree) {
/* extract zero or more parameters and process them individually */
- while(tvb_length_remaining(message_tvb, offset)) {
+ while(tvb_reported_length_remaining(message_tvb, offset)) {
length = tvb_get_ntohs(message_tvb, offset + PARAMETER_LENGTH_OFFSET);
padding_length = nr_of_padding_bytes(length);
total_length = length + padding_length;
@@ -851,7 +851,7 @@ dissect_iua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the m3ua protocol tree */
- iua_item = proto_tree_add_item(tree, proto_iua, message_tvb, 0, tvb_length(message_tvb), FALSE);
+ iua_item = proto_tree_add_item(tree, proto_iua, message_tvb, 0, -1, FALSE);
iua_tree = proto_item_add_subtree(iua_item, ett_iua);
} else {
iua_tree = NULL;
diff --git a/packet-klm.c b/packet-klm.c
index bbec6f4e7d..1e99dbbbd7 100644
--- a/packet-klm.c
+++ b/packet-klm.c
@@ -1,7 +1,7 @@
/* packet-klm.c 2001 Ronnie Sahlberg <See AUTHORS for email>
* Routines for klm dissection
*
- * $Id: packet-klm.c,v 1.6 2001/12/23 21:36:57 guy Exp $
+ * $Id: packet-klm.c,v 1.7 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -71,7 +71,7 @@ dissect_holder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
proto_tree* lock_tree = NULL;
lock_item = proto_tree_add_item(tree, hf_klm_holder, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
lock_tree = proto_item_add_subtree(lock_item, ett_klm_holder);
@@ -97,7 +97,7 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
proto_tree* lock_tree = NULL;
lock_item = proto_tree_add_item(tree, hf_klm_lock, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
lock_tree = proto_item_add_subtree(lock_item, ett_klm_lock);
@@ -258,4 +258,3 @@ proto_reg_handoff_klm(void)
/* Register the procedure tables */
rpc_init_proc_table(KLM_PROGRAM, 1, klm1_proc);
}
-
diff --git a/packet-lapb.c b/packet-lapb.c
index 6f459034eb..79e25b5147 100644
--- a/packet-lapb.c
+++ b/packet-lapb.c
@@ -2,7 +2,7 @@
* Routines for lapb frame disassembly
* Olivier Abad <oabad@cybercable.fr>
*
- * $Id: packet-lapb.c,v 1.33 2002/01/21 07:36:36 guy Exp $
+ * $Id: packet-lapb.c,v 1.34 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -81,8 +81,8 @@ dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
col_set_str(pinfo->cinfo, COL_INFO, "Invalid LAPB frame");
if (tree)
- ti = proto_tree_add_protocol_format(tree, proto_lapb, tvb, 0,
- tvb_length(tvb), "Invalid LAPB frame");
+ ti = proto_tree_add_protocol_format(tree, proto_lapb, tvb, 0, -1,
+ "Invalid LAPB frame");
return;
}
@@ -106,7 +106,7 @@ dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ett_lapb_control, is_response, FALSE);
/* not end of frame ==> X.25 */
- if (tvb_length(tvb) > 2) {
+ if (tvb_reported_length(tvb) > 2) {
next_tvb = tvb_new_subset(tvb, 2, -1, -1);
call_dissector(x25_handle, next_tvb, pinfo, tree);
}
diff --git a/packet-ldap.c b/packet-ldap.c
index f7b33f8bfc..87c0a2e646 100644
--- a/packet-ldap.c
+++ b/packet-ldap.c
@@ -1,7 +1,7 @@
/* packet-ldap.c
* Routines for ldap packet dissection
*
- * $Id: packet-ldap.c,v 1.33 2002/01/21 07:36:36 guy Exp $
+ * $Id: packet-ldap.c,v 1.34 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -913,10 +913,10 @@ dissect_ldap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree)
{
- ti = proto_tree_add_item(tree, proto_ldap, tvb, message_start,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ldap, tvb, message_start, -1,
+ FALSE);
ldap_tree = proto_item_add_subtree(ti, ett_ldap);
- proto_tree_add_text(ldap_tree, tvb, message_start, tvb_length(tvb),
+ proto_tree_add_text(ldap_tree, tvb, message_start, -1,
"Invalid LDAP packet");
}
break;
diff --git a/packet-lpd.c b/packet-lpd.c
index 3ec7024172..9ac551a037 100644
--- a/packet-lpd.c
+++ b/packet-lpd.c
@@ -2,7 +2,7 @@
* Routines for LPR and LPRng packet disassembly
* Gilbert Ramirez <gram@alumni.rice.edu>
*
- * $Id: packet-lpd.c,v 1.34 2002/01/21 23:35:32 guy Exp $
+ * $Id: packet-lpd.c,v 1.35 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -110,8 +110,7 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_lpd, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_lpd, tvb, 0, -1, FALSE);
lpd_tree = proto_item_add_subtree(ti, ett_lpd);
if (lpr_packet_type == response) {
diff --git a/packet-m2tp.c b/packet-m2tp.c
index 3fe7a4f6c5..2f86b87172 100644
--- a/packet-m2tp.c
+++ b/packet-m2tp.c
@@ -5,7 +5,7 @@
*
* Copyright 2001, Heinz Prantner <heinz.prantner[AT]radisys.com>
*
- * $Id: packet-m2tp.c,v 1.2 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-m2tp.c,v 1.3 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -526,7 +526,7 @@ dissect_m2tp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2tp
offset += COMMON_HEADER_LENGTH;
/* extract zero or more parameters and process them individually */
- while(tvb_length_remaining(message_tvb, offset)) {
+ while(tvb_reported_length_remaining(message_tvb, offset)) {
length = tvb_get_ntohs(message_tvb, offset + PARAMETER_LENGTH_OFFSET);
padding_length = nr_of_padding_bytes(length);
total_length = length + padding_length;
@@ -553,7 +553,7 @@ dissect_m2tp(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the m2tp protocol tree */
- m2tp_item = proto_tree_add_item(tree, proto_m2tp, message_tvb, 0, tvb_length(message_tvb), FALSE);
+ m2tp_item = proto_tree_add_item(tree, proto_m2tp, message_tvb, 0, -1, FALSE);
m2tp_tree = proto_item_add_subtree(m2tp_item, ett_m2tp);
} else {
m2tp_item = NULL;
diff --git a/packet-m3ua.c b/packet-m3ua.c
index ddf22ad50a..a2694f2d12 100644
--- a/packet-m3ua.c
+++ b/packet-m3ua.c
@@ -8,7 +8,7 @@
*
* Copyright 2000, Michael Txen <Michael.Tuexen@icn.siemens.de>
*
- * $Id: packet-m3ua.c,v 1.11 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-m3ua.c,v 1.12 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -802,7 +802,7 @@ dissect_m3ua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree
if (m3ua_tree) {
/* extract zero or more parameters and process them individually */
- while(tvb_length_remaining(message_tvb, offset)) {
+ while(tvb_reported_length_remaining(message_tvb, offset)) {
length = tvb_get_ntohs(message_tvb, offset + PARAMETER_LENGTH_OFFSET);
padding_length = nr_of_padding_bytes(length);
total_length = length + padding_length;
@@ -829,7 +829,7 @@ dissect_m3ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the m3ua protocol tree */
- m3ua_item = proto_tree_add_item(tree, proto_m3ua, message_tvb, 0, tvb_length(message_tvb), FALSE);
+ m3ua_item = proto_tree_add_item(tree, proto_m3ua, message_tvb, 0, -1, FALSE);
m3ua_tree = proto_item_add_subtree(m3ua_item, ett_m3ua);
} else {
m3ua_tree = NULL;
diff --git a/packet-mapi.c b/packet-mapi.c
index 8b966c7fd4..fe9027dc4e 100644
--- a/packet-mapi.c
+++ b/packet-mapi.c
@@ -1,7 +1,7 @@
/* packet-mapi.c
* Routines for MSX mapi packet dissection
*
- * $Id: packet-mapi.c,v 1.19 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-mapi.c,v 1.20 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -84,23 +84,22 @@ dissect_mapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
if (tree)
{
- ti = proto_tree_add_item(tree, proto_mapi, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_mapi, tvb, 0, -1, FALSE);
mapi_tree = proto_item_add_subtree(ti, ett_mapi);
if (pinfo->match_port == pinfo->destport)
{
proto_tree_add_boolean_hidden(mapi_tree, hf_mapi_request, tvb,
- 0, tvb_length(tvb), TRUE);
- proto_tree_add_text(mapi_tree, tvb, 0,
- tvb_length(tvb), "Request: <opaque data>" );
+ 0, 0, TRUE);
+ proto_tree_add_text(mapi_tree, tvb, 0, -1,
+ "Request: <opaque data>" );
}
else
{
proto_tree_add_boolean_hidden(mapi_tree, hf_mapi_response, tvb,
- 0, tvb_length(tvb), TRUE);
- proto_tree_add_text(mapi_tree, tvb, 0,
- tvb_length(tvb), "Response: <opaque data>");
+ 0, 0, TRUE);
+ proto_tree_add_text(mapi_tree, tvb, 0, -1,
+ "Response: <opaque data>");
}
}
}
diff --git a/packet-mip.c b/packet-mip.c
index 14b960c64b..fee40ead6a 100644
--- a/packet-mip.c
+++ b/packet-mip.c
@@ -2,7 +2,7 @@
* Routines for Mobile IP dissection
* Copyright 2000, Stefan Raab <sraab@cisco.com>
*
- * $Id: packet-mip.c,v 1.26 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-mip.c,v 1.27 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -181,8 +181,7 @@ dissect_mip_extensions( tvbuff_t *tvb, int offset, packet_info *pinfo,
if (!tree) return;
/* Add our tree, if we have extensions */
- ti = proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Extensions");
+ ti = proto_tree_add_text(tree, tvb, offset, -1, "Extensions");
exts_tree = proto_item_add_subtree(ti, ett_mip_exts);
/* And, handle each extension */
@@ -295,7 +294,7 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ip_to_str(tvb_get_ptr(tvb,12,4)));
if (tree) {
- ti = proto_tree_add_item(tree, proto_mip, tvb, offset, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, FALSE);
mip_tree = proto_item_add_subtree(ti, ett_mip);
/* type */
@@ -347,7 +346,7 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
/* Add Subtree */
- ti = proto_tree_add_item(tree, proto_mip, tvb, offset, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, FALSE);
mip_tree = proto_item_add_subtree(ti, ett_mip);
/* Type */
diff --git a/packet-mmse.c b/packet-mmse.c
index 84f0d5e84f..d12aeaf922 100644
--- a/packet-mmse.c
+++ b/packet-mmse.c
@@ -2,7 +2,7 @@
* Routines for MMS Message Encapsulation dissection
* Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
*
- * $Id: packet-mmse.c,v 1.6 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-mmse.c,v 1.7 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -377,8 +377,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = 2; /* Skip Message-Type */
/* create display subtree for the protocol */
- ti = proto_tree_add_item(tree, proto_mmse, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_mmse, tvb, 0, -1, FALSE);
mmse_tree = proto_item_add_subtree(ti, ett_mmse);
/* Report PDU-type */
diff --git a/packet-mpeg1.c b/packet-mpeg1.c
index 975245f079..a9c38358f4 100644
--- a/packet-mpeg1.c
+++ b/packet-mpeg1.c
@@ -2,7 +2,7 @@
*
* Routines for RFC 2250 MPEG-1 dissection
*
- * $Id: packet-mpeg1.c,v 1.5 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-mpeg1.c,v 1.6 2002/01/24 09:20:49 guy Exp $
*
* Copyright 2001,
* Francisco Javier Cabello Torres, <fjcabello@vtools.es>
@@ -169,7 +169,7 @@ dissect_mpeg1( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
if ( tree )
{
- ti = proto_tree_add_item( tree, proto_mpg, tvb, offset, tvb_length( tvb ), FALSE );
+ ti = proto_tree_add_item( tree, proto_mpg, tvb, offset, -1, FALSE );
mpg_tree = proto_item_add_subtree( ti, ett_mpg );
proto_tree_add_uint( mpg_tree, hf_rtp_mpg_mbz, tvb, offset, 1, mpg_mbz );
diff --git a/packet-msdp.c b/packet-msdp.c
index 5097417ba0..e38e5cdb18 100644
--- a/packet-msdp.c
+++ b/packet-msdp.c
@@ -4,7 +4,7 @@
*
* Copyright 2001, Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-msdp.c,v 1.5 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-msdp.c,v 1.6 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -200,11 +200,11 @@ dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 type;
guint16 length;
- ti = proto_tree_add_item(tree, proto_msdp, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_msdp, tvb, 0, -1, FALSE);
msdp_tree = proto_item_add_subtree(ti, ett_msdp);
offset = 0;
- while (tvb_length_remaining(tvb, offset) >= 3) {
+ while (tvb_reported_length_remaining(tvb, offset) >= 3) {
type = tvb_get_guint8(tvb, offset);
length = tvb_get_ntohs(tvb, offset + 1);
if (length < 3)
@@ -236,7 +236,7 @@ dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_length_remaining(tvb, offset) > 0)
proto_tree_add_text(msdp_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Trailing junk");
+ -1, "Trailing junk");
}
return;
@@ -285,14 +285,14 @@ static void dissect_msdp_sa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*
* Check if an encapsulated multicast IPv4 packet follows
*/
- if (tvb_length_remaining(tvb, *offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, *offset) > 0) {
proto_item *ei;
proto_tree *enc_tree;
tvbuff_t *next_tvb;
- ei = proto_tree_add_text(tree, tvb, *offset, tvb_length_remaining(tvb, *offset),
+ ei = proto_tree_add_text(tree, tvb, *offset, -1,
"Encapsulated IPv4 packet: %u bytes",
- tvb_length_remaining(tvb, *offset));
+ tvb_reported_length_remaining(tvb, *offset));
enc_tree = proto_item_add_subtree(ei, ett_msdp_sa_enc_data);
next_tvb = tvb_new_subset(tvb, *offset, -1, -1);
diff --git a/packet-msproxy.c b/packet-msproxy.c
index d42100197f..7327163bc2 100644
--- a/packet-msproxy.c
+++ b/packet-msproxy.c
@@ -2,7 +2,7 @@
* Routines for Microsoft Proxy packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-msproxy.c,v 1.26 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-msproxy.c,v 1.27 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1145,8 +1145,8 @@ static void dissect_msproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) { /* if proto tree, decode data */
- ti = proto_tree_add_item( tree, proto_msproxy, tvb, 0,
- tvb_length(tvb), FALSE );
+ ti = proto_tree_add_item( tree, proto_msproxy, tvb, 0, -1,
+ FALSE );
msproxy_tree = proto_item_add_subtree(ti, ett_msproxy);
}
diff --git a/packet-ncp.c b/packet-ncp.c
index 7c6fcc4183..cad8040973 100644
--- a/packet-ncp.c
+++ b/packet-ncp.c
@@ -3,7 +3,7 @@
* Gilbert Ramirez <gram@alumni.rice.edu>
* Modified to allow NCP over TCP/IP decodes by James Coe <jammer@cin.net>
*
- * $Id: packet-ncp.c,v 1.54 2002/01/21 07:36:37 guy Exp $
+ * $Id: packet-ncp.c,v 1.55 2002/01/24 09:20:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -275,7 +275,7 @@ dissect_ncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
nw_connection = (header.conn_high << 16) + header.conn_low;
if (tree) {
- ti = proto_tree_add_item(tree, proto_ncp, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ncp, tvb, 0, -1, FALSE);
ncp_tree = proto_item_add_subtree(ti, ett_ncp);
if ( pinfo->ptype == PT_TCP || pinfo->ptype == PT_UDP ) {
diff --git a/packet-ndmp.c b/packet-ndmp.c
index 517f6d636a..233815258d 100644
--- a/packet-ndmp.c
+++ b/packet-ndmp.c
@@ -12,7 +12,7 @@
* Routines for NDMP dissection
* 2001 Ronnie Sahlberg (see AUTHORS for email)
*
- * $Id: packet-ndmp.c,v 1.11 2002/01/21 23:35:32 guy Exp $
+ * $Id: packet-ndmp.c,v 1.12 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2313,13 +2313,13 @@ 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, tvb_length_remaining(tvb, offset), "Unknown type of NDMP message: 0x%02x", nh->msg);
+ proto_tree_add_text(tree, tvb, offset, -1, "Unknown type of NDMP message: 0x%02x", nh->msg);
offset+=tvb_length_remaining(tvb, offset);
return offset;
}
if(tree){
- cmd_item = proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ cmd_item = proto_tree_add_text(tree, tvb, offset, -1,
msg_vals[i].strptr);
cmd_tree = proto_item_add_subtree(cmd_item, ett_ndmp);
}
diff --git a/packet-nlm.c b/packet-nlm.c
index 3db7663cbd..e8297eb339 100644
--- a/packet-nlm.c
+++ b/packet-nlm.c
@@ -1,7 +1,7 @@
/* packet-nlm.c
* Routines for nlm dissection
*
- * $Id: packet-nlm.c,v 1.22 2001/12/23 21:36:57 guy Exp $
+ * $Id: packet-nlm.c,v 1.23 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -160,7 +160,7 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, i
if (tree) {
lock_item = proto_tree_add_item(tree, hf_nlm_lock, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
if (lock_item)
lock_tree = proto_item_add_subtree(lock_item, ett_nlm_lock);
}
@@ -252,9 +252,7 @@ dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (tree) {
lock_item = proto_tree_add_item(tree, hf_nlm_test_stat, tvb,
- offset,
- tvb_length_remaining(tvb, offset),
- FALSE);
+ offset, -1, FALSE);
if (lock_item)
lock_tree = proto_item_add_subtree(lock_item,
ett_nlm_lock);
@@ -264,15 +262,13 @@ dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset);
/* last structure is optional, only supplied for stat==1 (LOCKED) */
- if(!tvb_length_remaining(tvb, offset)){
+ if(tvb_reported_length_remaining(tvb, offset) == 0){
return offset;
}
if (tree) {
lock_item = proto_tree_add_item(lock_tree, hf_nlm_holder, tvb,
- offset,
- tvb_length_remaining(tvb, offset),
- FALSE);
+ offset, -1, FALSE);
if (lock_item)
lock_tree = proto_item_add_subtree(lock_item,
ett_nlm_lock);
@@ -313,9 +309,7 @@ dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (tree) {
lock_item = proto_tree_add_item(tree, hf_nlm_share, tvb,
- offset,
- tvb_length_remaining(tvb, offset),
- FALSE);
+ offset, -1, FALSE);
if (lock_item)
lock_tree = proto_item_add_subtree(lock_item,
ett_nlm_lock);
diff --git a/packet-nntp.c b/packet-nntp.c
index 0c68628f1b..67dbaad2fd 100644
--- a/packet-nntp.c
+++ b/packet-nntp.c
@@ -2,7 +2,7 @@
* Routines for nntp packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-nntp.c,v 1.23 2002/01/21 07:36:38 guy Exp $
+ * $Id: packet-nntp.c,v 1.24 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -83,8 +83,8 @@ dissect_nntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_nntp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_nntp, tvb, offset, -1,
+ FALSE);
nntp_tree = proto_item_add_subtree(ti, ett_nntp);
if (pinfo->match_port == pinfo->destport) {
diff --git a/packet-ntp.c b/packet-ntp.c
index b7fc392e3f..1cb2f13480 100644
--- a/packet-ntp.c
+++ b/packet-ntp.c
@@ -2,7 +2,7 @@
* Routines for NTP packet dissection
* Copyright 1999, Nathan Neulinger <nneul@umr.edu>
*
- * $Id: packet-ntp.c,v 1.33 2002/01/21 07:36:38 guy Exp $
+ * $Id: packet-ntp.c,v 1.34 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -280,8 +280,7 @@ dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
/* Adding NTP item and subtree */
- ti = proto_tree_add_item(tree, proto_ntp, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ntp, tvb, 0, -1, FALSE);
ntp_tree = proto_item_add_subtree(ti, ett_ntp);
flags = tvb_get_guint8(tvb, 0);
diff --git a/packet-ospf.c b/packet-ospf.c
index 669111e87f..480f631182 100644
--- a/packet-ospf.c
+++ b/packet-ospf.c
@@ -2,7 +2,7 @@
* Routines for OSPF packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-ospf.c,v 1.54 2002/01/21 07:36:38 guy Exp $
+ * $Id: packet-ospf.c,v 1.55 2002/01/24 09:20:50 guy Exp $
*
* At this time, this module is able to analyze OSPF
* packets as specified in RFC2328. MOSPF (RFC1584) and other
@@ -465,9 +465,7 @@ dissect_ospf_hello(tvbuff_t *tvb, int offset, proto_tree *tree, guint8 version)
proto_tree *ospf_hello_tree;
proto_item *ti;
- ti = proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
- "OSPF Hello Packet");
+ ti = proto_tree_add_text(tree, tvb, offset, -1, "OSPF Hello Packet");
ospf_hello_tree = proto_item_add_subtree(ti, ett_ospf_hello);
switch (version ) {
@@ -536,9 +534,7 @@ dissect_ospf_db_desc(tvbuff_t *tvb, int offset, proto_tree *tree, guint8 version
char flags_string[20] = "";
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
- "OSPF DB Description");
+ ti = proto_tree_add_text(tree, tvb, offset, -1, "OSPF DB Description");
ospf_db_desc_tree = proto_item_add_subtree(ti, ett_ospf_desc);
switch (version ) {
@@ -682,9 +678,7 @@ dissect_ospf_ls_upd(tvbuff_t *tvb, int offset, proto_tree *tree, guint8 version)
guint32 lsa_nr;
guint32 lsa_counter;
- ti = proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
- "LS Update Packet");
+ ti = proto_tree_add_text(tree, tvb, offset, -1, "LS Update Packet");
ospf_lsa_upd_tree = proto_item_add_subtree(ti, ett_ospf_lsa_upd);
lsa_nr = tvb_get_ntohl(tvb, offset);
diff --git a/packet-pim.c b/packet-pim.c
index 2b99cc27a0..fb23456fc9 100644
--- a/packet-pim.c
+++ b/packet-pim.c
@@ -2,7 +2,7 @@
* Routines for PIM disassembly
* (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org>
*
- * $Id: packet-pim.c,v 1.37 2002/01/21 07:36:38 guy Exp $
+ * $Id: packet-pim.c,v 1.38 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -135,8 +135,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_clear(pinfo->cinfo, COL_INFO);
if (tree) {
- ti = proto_tree_add_item(tree, proto_pim, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_pim, tvb, offset, -1, FALSE);
pim_tree = proto_item_add_subtree(ti, ett_pim);
/* Put IGMP type, 0x14, into the tree */
@@ -280,8 +279,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* e.g. an IPv6 data packet is encapsulated in IPv6 PIM packet.
*/
if (pinfo->src.type == AT_IPv4) {
- proto_tree_add_text(pimopt_tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"IPv4 dummy header");
proto_tree_add_text(pimopt_tree, tvb, offset + 12, 4,
"Source: %s",
@@ -293,8 +291,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
struct ip6_hdr ip6_hdr;
tvb_memcpy(tvb, (guint8 *)&ip6_hdr, offset,
tvb_length_remaining(tvb, offset));
- proto_tree_add_text(pimopt_tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"IPv6 dummy header");
proto_tree_add_text(pimopt_tree, tvb,
offset + offsetof(struct ip6_hdr, ip6_src), 16,
@@ -305,8 +302,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"Group: %s",
ip6_to_str(&ip6_hdr.ip6_dst));
} else
- proto_tree_add_text(pimopt_tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"Dummy header for an unknown protocol");
break;
case 4: /* IPv4 */
@@ -324,8 +320,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
#endif
break;
default:
- proto_tree_add_text(pimopt_tree, tvb,
- offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"Unknown IP version %d", (v_hl & 0xf0) >> 4);
break;
}
@@ -650,8 +645,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
col_add_str(pinfo->cinfo, COL_INFO, typestr);
if (tree) {
- ti = proto_tree_add_item(tree, proto_pim, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_pim, tvb, offset, -1, FALSE);
pim_tree = proto_item_add_subtree(ti, ett_pim);
proto_tree_add_uint(pim_tree, hf_pim_version, tvb, offset, 1,
@@ -741,8 +735,8 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
offset += 4;
if (tvb_reported_length_remaining(tvb, offset) > 0) {
- tiopt = proto_tree_add_text(pim_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "PIM parameters");
+ tiopt = proto_tree_add_text(pim_tree, tvb, offset, -1,
+ "PIM parameters");
pimopt_tree = proto_item_add_subtree(tiopt, ett_pim);
} else
goto done;
@@ -805,8 +799,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
* e.g. an IPv6 data packet is encapsulated in IPv6 PIM packet.
*/
if (pinfo->src.type == AT_IPv4) {
- proto_tree_add_text(pimopt_tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"IPv4 dummy header");
proto_tree_add_text(pimopt_tree, tvb, offset + 12, 4,
"Source: %s",
@@ -818,8 +811,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
struct ip6_hdr ip6_hdr;
tvb_memcpy(tvb, (guint8 *)&ip6_hdr, offset,
tvb_length_remaining(tvb, offset));
- proto_tree_add_text(pimopt_tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"IPv6 dummy header");
proto_tree_add_text(pimopt_tree, tvb,
offset + offsetof(struct ip6_hdr, ip6_src), 16,
@@ -830,8 +822,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
"Group: %s",
ip6_to_str(&ip6_hdr.ip6_dst));
} else
- proto_tree_add_text(pimopt_tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"Dummy header for an unknown protocol");
break;
case 4: /* IPv4 */
@@ -849,8 +840,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
#endif
break;
default:
- proto_tree_add_text(pimopt_tree, tvb,
- offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"Unknown IP version %d", (v_hl & 0xf0) >> 4);
break;
}
diff --git a/packet-pop.c b/packet-pop.c
index 6a205c4576..5b6a4b6f2d 100644
--- a/packet-pop.c
+++ b/packet-pop.c
@@ -2,7 +2,7 @@
* Routines for pop packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-pop.c,v 1.29 2002/01/21 07:36:38 guy Exp $
+ * $Id: packet-pop.c,v 1.30 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -107,8 +107,8 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_pop, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_pop, tvb, offset, -1,
+ FALSE);
pop_tree = proto_item_add_subtree(ti, ett_pop);
if (is_continuation) {
diff --git a/packet-q2931.c b/packet-q2931.c
index b3ecefeea0..487c1eda1f 100644
--- a/packet-q2931.c
+++ b/packet-q2931.c
@@ -2,7 +2,7 @@
* Routines for Q.2931 frame disassembly
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-q2931.c,v 1.21 2002/01/21 07:36:38 guy Exp $
+ * $Id: packet-q2931.c,v 1.22 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1991,8 +1991,8 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Q.2931");
if (tree) {
- ti = proto_tree_add_item(tree, proto_q2931, tvb, offset,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_q2931, tvb, offset, -1,
+ FALSE);
q2931_tree = proto_item_add_subtree(ti, ett_q2931);
proto_tree_add_uint(q2931_tree, hf_q2931_discriminator, tvb, offset, 1, tvb_get_guint8(tvb, offset));
diff --git a/packet-q931.c b/packet-q931.c
index f0ed89e2bc..2914e05278 100644
--- a/packet-q931.c
+++ b/packet-q931.c
@@ -2,7 +2,7 @@
* Routines for Q.931 frame disassembly
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-q931.c,v 1.34 2002/01/21 07:36:38 guy Exp $
+ * $Id: packet-q931.c,v 1.35 2002/01/24 09:20:50 guy Exp $
*
* Modified by Andreas Sikkema for possible use with H.323
*
@@ -2226,8 +2226,8 @@ q931_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Q.931");
if (tree) {
- ti = proto_tree_add_item(tree, proto_q931, tvb, offset,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_q931, tvb, offset, -1,
+ FALSE);
q931_tree = proto_item_add_subtree(ti, ett_q931);
dissect_q931_protocol_discriminator(tvb, offset, q931_tree);
diff --git a/packet-qllc.c b/packet-qllc.c
index 34bc2618f3..b202b4b1b3 100644
--- a/packet-qllc.c
+++ b/packet-qllc.c
@@ -2,7 +2,7 @@
* Routines for QLLC protocol - Qualified? LLC
* Gilbert Ramirez <gram@alumni.rice.edu>
*
- * $Id: packet-qllc.c,v 1.4 2002/01/21 07:36:40 guy Exp $
+ * $Id: packet-qllc.c,v 1.5 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -91,8 +91,8 @@ dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
if (tree) {
- qllc_ti = proto_tree_add_item(tree, proto_qllc, tvb, 0,
- tvb_length(tvb), FALSE);
+ qllc_ti = proto_tree_add_item(tree, proto_qllc, tvb, 0, -1,
+ FALSE);
qllc_tree = proto_item_add_subtree(qllc_ti, ett_qllc);
}
diff --git a/packet-quake.c b/packet-quake.c
index 59f2a9dd3d..a7ff116f50 100644
--- a/packet-quake.c
+++ b/packet-quake.c
@@ -4,7 +4,7 @@
* Uwe Girlich <uwe@planetquake.com>
* http://www.idsoftware.com/q1source/q1source.zip
*
- * $Id: packet-quake.c,v 1.24 2002/01/21 07:36:40 guy Exp $
+ * $Id: packet-quake.c,v 1.25 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -453,7 +453,7 @@ dissect_quake_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
control_item = proto_tree_add_text(tree, tvb,
- 0, tvb_length(tvb), "Control %s: %s",
+ 0, -1, "Control %s: %s",
val_to_str(direction, names_control_direction, "%u"),
val_to_str(command, names_control_command, "%u"));
if (control_item)
@@ -531,7 +531,7 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
quake_item = proto_tree_add_item(tree, proto_quake,
- tvb, 0, tvb_length(tvb), FALSE);
+ tvb, 0, -1, FALSE);
if (quake_item)
quake_tree = proto_item_add_subtree(quake_item, ett_quake);
}
@@ -744,4 +744,3 @@ proto_register_quake(void)
"Set the UDP port for the Quake Server",
10, &gbl_quakeServerPort);
}
-
diff --git a/packet-quake2.c b/packet-quake2.c
index 7a9e11f263..94635790f3 100644
--- a/packet-quake2.c
+++ b/packet-quake2.c
@@ -7,7 +7,7 @@
* http://www.dgs.monash.edu.au/~timf/bottim/
* http://www.opt-sci.Arizona.EDU/Pandora/default.asp
*
- * $Id: packet-quake2.c,v 1.8 2002/01/21 07:36:40 guy Exp $
+ * $Id: packet-quake2.c,v 1.9 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -86,7 +86,7 @@ dissect_quake2_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo,
marker = tvb_get_ntohl(tvb, 0);
if (tree) {
cl_item = proto_tree_add_text(tree, tvb,
- 0, tvb_length(tvb), "Connectionless");
+ 0, -1, "Connectionless");
if (cl_item)
cl_tree = proto_item_add_subtree(
cl_item, ett_quake2_connectionless);
@@ -171,7 +171,7 @@ dissect_quake2_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
if (tree) {
game_item = proto_tree_add_text(tree, tvb,
- 0, tvb_length(tvb), "Game");
+ 0, -1, "Game");
if (game_item)
game_tree = proto_item_add_subtree(
game_item, ett_quake2_game);
@@ -236,8 +236,7 @@ dissect_quake2_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *c_tree = NULL;
if (tree) {
c_item = proto_tree_add_text(game_tree, next_tvb,
- 0, tvb_length(next_tvb),
- "Client Commands");
+ 0, -1, "Client Commands");
if (c_item) {
c_tree = proto_item_add_subtree(
c_item, ett_quake2_game_clc);
@@ -250,8 +249,7 @@ dissect_quake2_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *c_tree = NULL;
if (tree) {
c_item = proto_tree_add_text(game_tree, next_tvb,
- 0, tvb_length(next_tvb),
- "Server Commands");
+ 0, -1, "Server Commands");
if (c_item) {
c_tree = proto_item_add_subtree(
c_item, ett_quake2_game_svc);
@@ -281,7 +279,7 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
quake2_item = proto_tree_add_item(tree, proto_quake2,
- tvb, 0, tvb_length(tvb), FALSE);
+ tvb, 0, -1, FALSE);
if (quake2_item)
quake2_tree = proto_item_add_subtree(
quake2_item, ett_quake2);
diff --git a/packet-quake3.c b/packet-quake3.c
index 9f4bbc3fa2..e544624be4 100644
--- a/packet-quake3.c
+++ b/packet-quake3.c
@@ -3,7 +3,7 @@
*
* Uwe Girlich <uwe@planetquake.com>
*
- * $Id: packet-quake3.c,v 1.9 2002/01/21 07:36:40 guy Exp $
+ * $Id: packet-quake3.c,v 1.10 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -164,7 +164,7 @@ dissect_quake3_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo,
marker = tvb_get_ntohl(tvb, 0);
if (tree) {
cl_item = proto_tree_add_text(tree, tvb,
- 0, tvb_length(tvb), "Connectionless");
+ 0, -1, "Connectionless");
if (cl_item)
cl_tree = proto_item_add_subtree(
cl_item, ett_quake3_connectionless);
@@ -277,7 +277,7 @@ dissect_quake3_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo,
/* now we decode all the rest */
base = offset + 18;
/* '/', ip-address in network order, port in network order */
- while (tvb_length_remaining(tvb, base) >= 7) {
+ while (tvb_reported_length_remaining(tvb, base) >= 7) {
guint32 ip_addr;
guint16 udp_port;
proto_item *server_item = NULL;
@@ -393,7 +393,7 @@ dissect_quake3_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
if (tree) {
game_item = proto_tree_add_text(tree, tvb,
- 0, tvb_length(tvb), "Game");
+ 0, -1, "Game");
if (game_item)
game_tree = proto_item_add_subtree(
game_item, ett_quake3_game);
@@ -458,8 +458,7 @@ dissect_quake3_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *c_tree = NULL;
if (tree) {
c_item = proto_tree_add_text(game_tree, next_tvb,
- 0, tvb_length(next_tvb),
- "Client Commands");
+ 0, -1, "Client Commands");
if (c_item) {
c_tree = proto_item_add_subtree(
c_item, ett_quake3_game_clc);
@@ -472,8 +471,7 @@ dissect_quake3_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *c_tree = NULL;
if (tree) {
c_item = proto_tree_add_text(game_tree, next_tvb,
- 0, tvb_length(next_tvb),
- "Server Commands");
+ 0, -1, "Server Commands");
if (c_item) {
c_tree = proto_item_add_subtree(
c_item, ett_quake3_game_svc);
@@ -500,7 +498,7 @@ dissect_quake3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
quake3_item = proto_tree_add_item(tree, proto_quake3,
- tvb, 0, tvb_length(tvb), FALSE);
+ tvb, 0, -1, FALSE);
if (quake3_item)
quake3_tree = proto_item_add_subtree(
quake3_item, ett_quake3);
diff --git a/packet-quakeworld.c b/packet-quakeworld.c
index 919cc5b8c4..0669b2497a 100644
--- a/packet-quakeworld.c
+++ b/packet-quakeworld.c
@@ -4,7 +4,7 @@
* Uwe Girlich <uwe@planetquake.com>
* http://www.idsoftware.com/q1source/q1source.zip
*
- * $Id: packet-quakeworld.c,v 1.10 2002/01/21 07:36:40 guy Exp $
+ * $Id: packet-quakeworld.c,v 1.11 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -373,7 +373,7 @@ dissect_quakeworld_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo,
marker = tvb_get_ntohl(tvb, 0);
if (tree) {
cl_item = proto_tree_add_text(tree, tvb,
- 0, tvb_length(tvb), "Connectionless");
+ 0, -1, "Connectionless");
if (cl_item)
cl_tree = proto_item_add_subtree(
cl_item, ett_quakeworld_connectionless);
@@ -621,7 +621,7 @@ dissect_quakeworld_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
if (tree) {
game_item = proto_tree_add_text(tree, tvb,
- 0, tvb_length(tvb), "Game");
+ 0, -1, "Game");
if (game_item)
game_tree = proto_item_add_subtree(
game_item, ett_quakeworld_game);
@@ -686,8 +686,7 @@ dissect_quakeworld_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *c_tree = NULL;
if (tree) {
c_item = proto_tree_add_text(game_tree, next_tvb,
- 0, tvb_length(next_tvb),
- "Client Commands");
+ 0, -1, "Client Commands");
if (c_item) {
c_tree = proto_item_add_subtree(
c_item, ett_quakeworld_game_clc);
@@ -700,8 +699,7 @@ dissect_quakeworld_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *c_tree = NULL;
if (tree) {
c_item = proto_tree_add_text(game_tree, next_tvb,
- 0, tvb_length(next_tvb),
- "Server Commands");
+ 0, -1, "Server Commands");
if (c_item) {
c_tree = proto_item_add_subtree(
c_item, ett_quakeworld_game_svc);
@@ -731,7 +729,7 @@ dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
quakeworld_item = proto_tree_add_item(tree, proto_quakeworld,
- tvb, 0, tvb_length(tvb), FALSE);
+ tvb, 0, -1, FALSE);
if (quakeworld_item)
quakeworld_tree = proto_item_add_subtree(
quakeworld_item, ett_quakeworld);
diff --git a/packet-ranap.c b/packet-ranap.c
index cb7856bfdc..7ca4eec7a5 100644
--- a/packet-ranap.c
+++ b/packet-ranap.c
@@ -3,7 +3,7 @@
* Based on 3GPP TS 25.413 V3.4.0
* Copyright 2001, Martin Held <Martin.Held@icn.siemens.de>
*
- * $Id: packet-ranap.c,v 1.10 2002/01/21 07:36:40 guy Exp $
+ * $Id: packet-ranap.c,v 1.11 2002/01/24 09:20:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -3424,13 +3424,9 @@ dissect_IE_CriticalityDiagnostics(tvbuff_t *tvb, proto_tree *ie_tree)
static int
dissect_unknown_IE(tvbuff_t *tvb, proto_tree *ie_tree)
{
- guint length;
-
if (ie_tree)
{
- length = tvb_length(tvb);
-
- proto_tree_add_text(ie_tree, tvb, 0, length,
+ proto_tree_add_text(ie_tree, tvb, 0, -1,
"IE Contents (dissection not implemented)");
}
return(0);
@@ -3991,7 +3987,6 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint tmp_bitoffset = 0;
guint extension_present;
- gint ie_tvb_length;
tvbuff_t *ie_tvb;
@@ -4042,7 +4037,7 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
/* create the ranap protocol tree */
- ranap_item = proto_tree_add_item(tree, proto_ranap, tvb, 0, tvb_length(tvb), FALSE);
+ ranap_item = proto_tree_add_item(tree, proto_ranap, tvb, 0, -1, FALSE);
ranap_tree = proto_item_add_subtree(ranap_item, ett_ranap);
/* Add fields to ranap protocol tree */
@@ -4086,8 +4081,7 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = PDU_NUMBER_OF_OCTETS_OFFSET + number_of_octets_size;
/* create a tvb containing the remainder of the PDU */
- ie_tvb_length = tvb_length(tvb)- offset;
- ie_tvb = tvb_new_subset(tvb, offset, ie_tvb_length, ie_tvb_length);
+ ie_tvb = tvb_new_subset(tvb, offset, -1, -1);
/* dissect the ies */
dissect_ranap_ie_container(ie_tvb, pinfo, tree, ranap_tree);
diff --git a/packet-rip.c b/packet-rip.c
index 079ce1ba30..4753330f79 100644
--- a/packet-rip.c
+++ b/packet-rip.c
@@ -2,7 +2,7 @@
* Routines for RIPv1 and RIPv2 packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-rip.c,v 1.29 2002/01/21 07:36:40 guy Exp $
+ * $Id: packet-rip.c,v 1.30 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -112,7 +112,7 @@ dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(command, command_vals, "Unknown command (%u)"));
if (tree) {
- ti = proto_tree_add_item(tree, proto_rip, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_rip, tvb, 0, -1, FALSE);
rip_tree = proto_item_add_subtree(ti, ett_rip);
proto_tree_add_uint(rip_tree, hf_rip_command, tvb, 0, 1, command);
diff --git a/packet-ripng.c b/packet-ripng.c
index 86537d23e0..0e136e1ba0 100644
--- a/packet-ripng.c
+++ b/packet-ripng.c
@@ -3,7 +3,7 @@
* (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org>
* derived from packet-rip.c
*
- * $Id: packet-ripng.c,v 1.24 2002/01/21 07:36:41 guy Exp $
+ * $Id: packet-ripng.c,v 1.25 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -82,8 +82,7 @@ dissect_ripng(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
val_to_str(rip6.rip6_cmd, cmdvals, "Unknown command (%u)"));
if (tree) {
- ti = proto_tree_add_item(tree, proto_ripng, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_ripng, tvb, offset, -1, FALSE);
ripng_tree = proto_item_add_subtree(ti, ett_ripng);
proto_tree_add_uint(ripng_tree, hf_ripng_cmd, tvb, offset, 1,
diff --git a/packet-rlogin.c b/packet-rlogin.c
index a2b8328198..1b36be4d72 100644
--- a/packet-rlogin.c
+++ b/packet-rlogin.c
@@ -2,7 +2,7 @@
* Routines for unix rlogin packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-rlogin.c,v 1.25 2002/01/21 07:36:41 guy Exp $
+ * $Id: packet-rlogin.c,v 1.26 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -189,8 +189,7 @@ static void rlogin_display( rlogin_hash_entry_t *hash_info, tvbuff_t *tvb,
gint ti_offset;
proto_item *user_info_item, *window_info_item;
- ti = proto_tree_add_item( tree, proto_rlogin, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item( tree, proto_rlogin, tvb, 0, -1, FALSE);
rlogin_tree = proto_item_add_subtree(ti, ett_rlogin);
@@ -243,7 +242,7 @@ static void rlogin_display( rlogin_hash_entry_t *hash_info, tvbuff_t *tvb,
* First frame of conversation, hence user info?
*/
user_info_item = proto_tree_add_item( rlogin_tree, hf_user_info, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
/*
* Do server user name.
@@ -333,8 +332,7 @@ static void rlogin_display( rlogin_hash_entry_t *hash_info, tvbuff_t *tvb,
/*
* There's more data in the frame.
*/
- proto_tree_add_text(rlogin_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Data");
+ proto_tree_add_text(rlogin_tree, tvb, offset, -1, "Data");
}
}
diff --git a/packet-rquota.c b/packet-rquota.c
index 3069b5a2ad..3ad363ec4a 100644
--- a/packet-rquota.c
+++ b/packet-rquota.c
@@ -2,7 +2,7 @@
* Routines for rquota dissection
* Copyright 2001, Mike Frisch <frisch@hummingbird.com>
*
- * $Id: packet-rquota.c,v 1.5 2001/11/27 22:37:20 guy Exp $
+ * $Id: packet-rquota.c,v 1.6 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -77,7 +77,7 @@ dissect_rquota(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
proto_tree *lock_tree = NULL;
lock_item = proto_tree_add_item(tree, hf_rquota_rquota, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
lock_tree = proto_item_add_subtree(lock_item, ett_rquota_rquota);
diff --git a/packet-rsh.c b/packet-rsh.c
index cb3e917693..27eb7493e4 100644
--- a/packet-rsh.c
+++ b/packet-rsh.c
@@ -4,7 +4,7 @@
* Robert Tsai <rtsai@netapp.com>
* Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-rsh.c,v 1.15 2002/01/21 07:36:41 guy Exp $
+ * $Id: packet-rsh.c,v 1.16 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -71,8 +71,8 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_format_text(tvb, offset, linelen));
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_rsh, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_rsh, tvb, offset, -1,
+ FALSE);
rsh_tree = proto_item_add_subtree(ti, ett_rsh);
/*
diff --git a/packet-rtp.c b/packet-rtp.c
index 9bcc052c5e..724dec55ef 100644
--- a/packet-rtp.c
+++ b/packet-rtp.c
@@ -6,7 +6,7 @@
* Copyright 2000, Philips Electronics N.V.
* Written by Andreas Sikkema <andreas.sikkema@philips.com>
*
- * $Id: packet-rtp.c,v 1.32 2002/01/21 07:36:41 guy Exp $
+ * $Id: packet-rtp.c,v 1.33 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -365,7 +365,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
}
if ( tree ) {
- ti = proto_tree_add_item( tree, proto_rtp, tvb, offset, tvb_length_remaining( tvb, offset ), FALSE );
+ ti = proto_tree_add_item( tree, proto_rtp, tvb, offset, -1, FALSE );
rtp_tree = proto_item_add_subtree( ti, ett_rtp );
proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb,
@@ -404,7 +404,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
}
if ( tree ) {
- ti = proto_tree_add_item( tree, proto_rtp, tvb, offset, tvb_length_remaining( tvb, offset ), FALSE );
+ ti = proto_tree_add_item( tree, proto_rtp, tvb, offset, -1, FALSE );
rtp_tree = proto_item_add_subtree( ti, ett_rtp );
proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb,
diff --git a/packet-sap.c b/packet-sap.c
index 248e430d77..ed434cdea2 100644
--- a/packet-sap.c
+++ b/packet-sap.c
@@ -4,7 +4,7 @@
*
* Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-sap.c,v 1.26 2002/01/21 07:36:41 guy Exp $
+ * $Id: packet-sap.c,v 1.27 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -162,8 +162,7 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- si = proto_tree_add_item(tree, proto_sap, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ si = proto_tree_add_item(tree, proto_sap, tvb, offset, -1, FALSE);
sap_tree = proto_item_add_subtree(si, ett_sap);
sif = proto_tree_add_uint(sap_tree, hf_sap_flags, tvb, offset, 1, vers_flags);
@@ -232,8 +231,7 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (is_enc && is_comp) mangle = "compressed and encrypted";
else if (is_enc) mangle = "encrypted";
else mangle = "compressed";
- proto_tree_add_text(sap_tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(sap_tree, tvb, offset, -1,
"The rest of the packet is %s", mangle);
return;
}
diff --git a/packet-sdp.c b/packet-sdp.c
index 5d26d565cc..c1fb1d4f6f 100644
--- a/packet-sdp.c
+++ b/packet-sdp.c
@@ -4,7 +4,7 @@
* Jason Lango <jal@netapp.com>
* Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-sdp.c,v 1.25 2002/01/21 07:36:42 guy Exp $
+ * $Id: packet-sdp.c,v 1.26 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -193,8 +193,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!tree)
return;
- ti = proto_tree_add_item(tree, proto_sdp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_sdp, tvb, offset, -1, FALSE);
sdp_tree = proto_item_add_subtree(ti, ett_sdp);
/*
diff --git a/packet-sip.c b/packet-sip.c
index 18772a1848..1e96262ea4 100644
--- a/packet-sip.c
+++ b/packet-sip.c
@@ -15,7 +15,7 @@
* Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
* Copyright 2001, Jean-Francois Mule <jfm@clarent.com>
*
- * $Id: packet-sip.c,v 1.21 2002/01/21 07:36:42 guy Exp $
+ * $Id: packet-sip.c,v 1.22 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -124,7 +124,7 @@ static void dissect_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *ti, *th;
proto_tree *sip_tree, *hdr_tree;
- ti = proto_tree_add_item(tree, proto_sip, tvb, 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_sip, tvb, 0, -1, FALSE);
sip_tree = proto_item_add_subtree(ti, ett_sip);
proto_tree_add_text(sip_tree, tvb, 0, next_offset, "%s-Line: %s",
diff --git a/packet-slimp3.c b/packet-slimp3.c
index ecbea5587f..ef38809b5a 100644
--- a/packet-slimp3.c
+++ b/packet-slimp3.c
@@ -6,7 +6,7 @@
* Adds support for the data packet protocol for the SliMP3
* See www.slimdevices.com for details.
*
- * $Id: packet-slimp3.c,v 1.2 2002/01/21 07:36:42 guy Exp $
+ * $Id: packet-slimp3.c,v 1.3 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -199,8 +199,7 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
addc_strp = addc_str;
if (tree) {
- ti = proto_tree_add_item(tree, proto_slimp3, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_slimp3, tvb, offset, -1, FALSE);
slimp3_tree = proto_item_add_subtree(ti, ett_slimp3);
proto_tree_add_uint(slimp3_tree, hf_slimp3_opcode, tvb,
@@ -259,7 +258,7 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Loop through the commands */
i1 = 18;
in_str = 0;
- while (i1 < tvb_length_remaining(tvb, offset)) {
+ while (i1 < tvb_reported_length_remaining(tvb, offset)) {
switch(tvb_get_guint8(tvb, offset + i1)) {
case 0:
in_str = 0;
@@ -374,11 +373,11 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset, 1, FALSE);
if (pinfo->destport == UDP_PORT_SLIMP3) {
/* Hello response; client->server */
- proto_tree_add_text(slimp3_tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(slimp3_tree, tvb, offset, -1,
"I2C Response (Client --> Server)");
} else {
/* Hello request; server->client */
- proto_tree_add_text(slimp3_tree, tvb, offset, tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(slimp3_tree, tvb, offset, -1,
"I2C Request (Server --> Client)");
}
}
@@ -411,8 +410,8 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_item_hidden(slimp3_tree, hf_slimp3_data,
tvb, offset, 1, FALSE);
- proto_tree_add_text(slimp3_tree, tvb, offset, tvb_length_remaining(tvb, offset),
- "Length: %d bytes", tvb_length_remaining(tvb, offset+18));
+ proto_tree_add_text(slimp3_tree, tvb, offset, -1,
+ "Length: %d bytes", tvb_reported_length_remaining(tvb, offset+18));
proto_tree_add_text(slimp3_tree, tvb, offset+2, 2,
"Buffer offset: %d bytes.",
tvb_get_ntohs(tvb, offset+2) * 2);
@@ -420,7 +419,7 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Length: %d bytes, Offset: %d bytes.",
- tvb_length_remaining(tvb, offset+18),
+ tvb_reported_length_remaining(tvb, offset+18),
tvb_get_ntohs(tvb, offset+2) * 2);
}
break;
@@ -466,8 +465,8 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
if (tree) {
- proto_tree_add_text(slimp3_tree, tvb, offset, tvb_length_remaining(tvb, offset),
- "Data (%d bytes)", tvb_length_remaining(tvb, offset));
+ proto_tree_add_text(slimp3_tree, tvb, offset, -1,
+ "Data (%d bytes)", tvb_reported_length_remaining(tvb, offset));
}
break;
diff --git a/packet-smb-browse.c b/packet-smb-browse.c
index fc47798df9..78c20975b1 100644
--- a/packet-smb-browse.c
+++ b/packet-smb-browse.c
@@ -2,7 +2,7 @@
* Routines for SMB Browser packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-smb-browse.c,v 1.20 2002/01/21 07:36:42 guy Exp $
+ * $Id: packet-smb-browse.c,v 1.21 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -559,7 +559,7 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
if (parent_tree) {
- item = proto_tree_add_item(parent_tree, proto_smb_browse, tvb, offset, tvb_length_remaining(tvb, offset), TRUE);
+ item = proto_tree_add_item(parent_tree, proto_smb_browse, tvb, offset, -1, TRUE);
tree = proto_item_add_subtree(item, ett_browse);
}
@@ -786,7 +786,7 @@ dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
if (parent_tree) {
- item = proto_tree_add_item(parent_tree, proto_smb_browse, tvb, offset, tvb_length_remaining(tvb, offset), TRUE);
+ item = proto_tree_add_item(parent_tree, proto_smb_browse, tvb, offset, -1, TRUE);
tree = proto_item_add_subtree(item, ett_browse);
}
diff --git a/packet-smb-common.c b/packet-smb-common.c
index 9955ba1f0c..c15c6f7df8 100644
--- a/packet-smb-common.c
+++ b/packet-smb-common.c
@@ -2,7 +2,7 @@
* Common routines for smb packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-smb-common.c,v 1.7 2001/07/08 20:38:26 guy Exp $
+ * $Id: packet-smb-common.c,v 1.8 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -88,11 +88,8 @@ dissect_smb_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off
{
/* display data as unknown */
- guint len;
+ proto_tree_add_text(tree, tvb, offset, -1, "Data (%u bytes)",
+ tvb_reported_length_remaining(tvb, offset));
- len = tvb_length_remaining(tvb, offset);
-
- proto_tree_add_text(tree, tvb, offset, len, "Data (%u bytes)", len);
-
- return offset+len;
+ return offset+tvb_length_remaining(tvb, offset);
}
diff --git a/packet-smb-logon.c b/packet-smb-logon.c
index d3a3e32599..ebd77d4e58 100644
--- a/packet-smb-logon.c
+++ b/packet-smb-logon.c
@@ -2,7 +2,7 @@
* Routines for SMB net logon packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-smb-logon.c,v 1.21 2001/12/10 00:25:34 guy Exp $
+ * $Id: packet-smb-logon.c,v 1.22 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -362,7 +362,7 @@ dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
/* A short Announce will not have the rest */
- if (tvb_length_remaining(tvb, offset) != 0) {
+ if (tvb_reported_length_remaining(tvb, offset) != 0) {
if (offset % 2) offset++; /* word align ... */
@@ -817,7 +817,7 @@ dissect_smb_logon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
item = proto_tree_add_item(tree, proto_smb_logon, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
smb_logon_tree = proto_item_add_subtree(item, ett_smb_logon);
}
diff --git a/packet-smtp.c b/packet-smtp.c
index 01ede5e4a3..7ff5985211 100644
--- a/packet-smtp.c
+++ b/packet-smtp.c
@@ -1,7 +1,7 @@
/* packet-smtp.c
* Routines for SMTP packet disassembly
*
- * $Id: packet-smtp.c,v 1.24 2002/01/21 07:36:43 guy Exp $
+ * $Id: packet-smtp.c,v 1.25 2002/01/24 09:20:51 guy Exp $
*
* Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com>
*
@@ -352,8 +352,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) { /* Build the tree info ... */
- ti = proto_tree_add_item(tree, proto_smtp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_smtp, tvb, offset, -1, FALSE);
smtp_tree = proto_item_add_subtree(ti, ett_smtp);
proto_tree_add_boolean_hidden(smtp_tree, (request ? hf_smtp_req : hf_smtp_rsp),
tvb, offset, 4, TRUE);
diff --git a/packet-snmp.c b/packet-snmp.c
index d1a050464f..e5d224d3a3 100644
--- a/packet-snmp.c
+++ b/packet-snmp.c
@@ -8,7 +8,7 @@
*
* See RFCs 1905, 1906, 1909, and 1910 for SNMPv2u.
*
- * $Id: packet-snmp.c,v 1.78 2002/01/21 07:36:43 guy Exp $
+ * $Id: packet-snmp.c,v 1.79 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1496,8 +1496,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
col_add_str(pinfo->cinfo, COL_PROTOCOL, proto_name);
if (tree) {
- item = proto_tree_add_item(tree, proto, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ item = proto_tree_add_item(tree, proto, tvb, offset, -1, FALSE);
snmp_tree = proto_item_add_subtree(item, ett);
}
@@ -1883,8 +1882,7 @@ dissect_smux_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMUX");
if (tree) {
- item = proto_tree_add_item(tree, proto, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ item = proto_tree_add_item(tree, proto, tvb, offset, -1, FALSE);
smux_tree = proto_item_add_subtree(item, ett);
}
diff --git a/packet-socks.c b/packet-socks.c
index d5cab46e7e..c024133604 100644
--- a/packet-socks.c
+++ b/packet-socks.c
@@ -2,7 +2,7 @@
* Routines for socks versions 4 &5 packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-socks.c,v 1.34 2002/01/21 07:36:43 guy Exp $
+ * $Id: packet-socks.c,v 1.35 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -409,8 +409,8 @@ socks_udp_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Version: 5, UDP Associated packet");
if ( tree) {
- ti = proto_tree_add_protocol_format( tree, proto_socks, tvb, offset,
- tvb_length_remaining(tvb, offset), "Socks" );
+ ti = proto_tree_add_protocol_format( tree, proto_socks, tvb,
+ offset, -1, "Socks" );
socks_tree = proto_item_add_subtree(ti, ett_socks);
@@ -897,8 +897,7 @@ display_ping_and_tracert(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
col_append_str(pinfo->cinfo, COL_INFO, ", Results");
if ( tree){
- proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset),
+ proto_tree_add_text(tree, tvb, offset, -1,
(hash_info->command == PING_COMMAND) ?
"Ping Results:" :
"Traceroute Results");
@@ -1035,8 +1034,8 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
/* if proto tree, decode and display */
if (tree) {
- ti = proto_tree_add_item( tree, proto_socks, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE );
+ ti = proto_tree_add_item( tree, proto_socks, tvb, offset, -1,
+ FALSE );
socks_tree = proto_item_add_subtree(ti, ett_socks);
diff --git a/packet-spray.c b/packet-spray.c
index 17c7cef9b2..607adadbfa 100644
--- a/packet-spray.c
+++ b/packet-spray.c
@@ -1,7 +1,7 @@
/* packet-spray.c
* 2001 Ronnie Sahlberg <See AUTHORS for email>
*
- * $Id: packet-spray.c,v 1.6 2001/12/23 21:36:57 guy Exp $
+ * $Id: packet-spray.c,v 1.7 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -56,7 +56,7 @@ dissect_get_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tre
hf_spray_counter, offset);
lock_item = proto_tree_add_item(tree, hf_spray_clock, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
lock_tree = proto_item_add_subtree(lock_item, ett_spray_clock);
diff --git a/packet-srvloc.c b/packet-srvloc.c
index 1f05b31a70..50a1130060 100644
--- a/packet-srvloc.c
+++ b/packet-srvloc.c
@@ -6,7 +6,7 @@
* In particular I have not had an opportunity to see how it
* responds to SRVLOC over TCP.
*
- * $Id: packet-srvloc.c,v 1.28 2002/01/21 07:36:43 guy Exp $
+ * $Id: packet-srvloc.c,v 1.29 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -244,8 +244,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(function, srvloc_functions, "Unknown Function (%u)"));
if (tree) {
- ti = proto_tree_add_item(tree, proto_srvloc, tvb, offset,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_srvloc, tvb, offset, -1, FALSE);
srvloc_tree = proto_item_add_subtree(ti, ett_srvloc);
proto_tree_add_uint(srvloc_tree, hf_srvloc_version, tvb, offset, 1,
@@ -486,7 +485,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
default:
- proto_tree_add_text(srvloc_tree, tvb, offset, tvb_length_remaining(tvb, offset), "Unknown Function Type");
+ proto_tree_add_text(srvloc_tree, tvb, offset, -1, "Unknown Function Type");
};
};
}
diff --git a/packet-ssl.c b/packet-ssl.c
index 01490dd9eb..5478087ee3 100644
--- a/packet-ssl.c
+++ b/packet-ssl.c
@@ -2,7 +2,7 @@
* Routines for ssl dissection
* Copyright (c) 2000-2001, Scott Renfro <scott@renfro.org>
*
- * $Id: packet-ssl.c,v 1.14 2002/01/21 07:36:43 guy Exp $
+ * $Id: packet-ssl.c,v 1.15 2002/01/24 09:20:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -595,8 +595,7 @@ dissect_ssl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Create display subtree for SSL as a whole */
if (tree)
{
- ti = proto_tree_add_item(tree, proto_ssl, tvb,
- 0, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ssl, tvb, 0, -1, FALSE);
ssl_tree = proto_item_add_subtree(ti, ett_ssl);
}
diff --git a/packet-stat.c b/packet-stat.c
index 0cc1dd5197..1fffb356ca 100644
--- a/packet-stat.c
+++ b/packet-stat.c
@@ -1,7 +1,7 @@
/* packet-stat.c
* Routines for stat dissection
*
- * $Id: packet-stat.c,v 1.11 2001/12/23 21:36:58 guy Exp $
+ * $Id: packet-stat.c,v 1.12 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -129,7 +129,7 @@ dissect_stat_stat_res(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
if (tree) {
lock_item = proto_tree_add_item(tree, hf_stat_stat_res, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
if (lock_item)
lock_tree = proto_item_add_subtree(lock_item, ett_stat_stat_res);
}
diff --git a/packet-sua.c b/packet-sua.c
index e121729b00..2c8c523f6d 100644
--- a/packet-sua.c
+++ b/packet-sua.c
@@ -6,7 +6,7 @@
*
* Copyright 2000, Michael Txen <Michael.Tuexen@icn.siemens.de>
*
- * $Id: packet-sua.c,v 1.5 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-sua.c,v 1.6 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1957,7 +1957,7 @@ dissect_sua_tlv_list(tvbuff_t *tlv_tvb, proto_tree *sua_tree, gint initial_offse
offset = initial_offset;
- while(tvb_length_remaining(tlv_tvb, offset)) {
+ while(tvb_reported_length_remaining(tlv_tvb, offset)) {
length = tvb_get_ntohs(tlv_tvb, offset + PARAMETER_LENGTH_OFFSET);
padding_length = nr_of_padding_bytes(length);
total_length = length + padding_length;
@@ -2078,13 +2078,13 @@ static void
dissect_sua_light_payload(tvbuff_t *payload_tvb, packet_info *pinfo,
guint16 subsystem_number, proto_tree *sual_tree, proto_tree *tree)
{
- guint payload_length = tvb_length(payload_tvb);
+ guint payload_length = tvb_reported_length(payload_tvb);
/* do lookup with the subdissector table */
if ( ! dissector_try_port (sua_light_dissector_table, subsystem_number, payload_tvb, pinfo, tree))
{
if (sual_tree)
- proto_tree_add_text(sual_tree, payload_tvb, 0, payload_length, "Payload: %u byte%s", payload_length, plurality(payload_length, "", "s"));
+ proto_tree_add_text(sual_tree, payload_tvb, 0, -1, "Payload: %u byte%s", payload_length, plurality(payload_length, "", "s"));
}
}
@@ -2143,7 +2143,7 @@ dissect_sua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
necessary to generate protocol tree items. */
if (tree) {
/* create the sua protocol tree */
- sua_item = proto_tree_add_item(tree, proto_sua, message_tvb, 0, tvb_length(message_tvb), FALSE);
+ sua_item = proto_tree_add_item(tree, proto_sua, message_tvb, 0, -1, FALSE);
sua_tree = proto_item_add_subtree(sua_item, ett_sua);
} else {
sua_tree = NULL;
diff --git a/packet-syslog.c b/packet-syslog.c
index 391e15a219..33bd44f0d5 100644
--- a/packet-syslog.c
+++ b/packet-syslog.c
@@ -3,7 +3,7 @@
*
* Copyright 2000, Gerald Combs <gerald@ethereal.com>
*
- * $Id: packet-syslog.c,v 1.14 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-syslog.c,v 1.15 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -149,8 +149,6 @@ static void dissect_syslog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
- msg_len = tvb_length(tvb);
-
if (tvb_get_guint8(tvb, 0) == '<' && isdigit(tvb_get_guint8(tvb, 1))) {
msg_off++;
pri = 0;
@@ -187,13 +185,13 @@ static void dissect_syslog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
if (pri >= 0) {
- ti = proto_tree_add_protocol_format(tree, proto_syslog, tvb, 0,
- tvb_length(tvb), "Syslog message: %s.%s: %s",
+ ti = proto_tree_add_protocol_format(tree, proto_syslog, tvb, 0, -1,
+ "Syslog message: %s.%s: %s",
val_to_str(fac, short_fac, "UNKNOWN"),
val_to_str(lev, short_lev, "UNKNOWN"), msg_str);
} else {
- ti = proto_tree_add_protocol_format(tree, proto_syslog, tvb, 0,
- tvb_length(tvb), "Syslog message: (unknown): %s", msg_str);
+ ti = proto_tree_add_protocol_format(tree, proto_syslog, tvb, 0, -1,
+ "Syslog message: (unknown): %s", msg_str);
}
syslog_tree = proto_item_add_subtree(ti, ett_syslog);
if (pri >= 0) {
diff --git a/packet-tacacs.c b/packet-tacacs.c
index b389fde1cf..4932883dfd 100644
--- a/packet-tacacs.c
+++ b/packet-tacacs.c
@@ -2,7 +2,7 @@
* Routines for cisco tacacs/xtacacs/tacacs+ packet dissection
* Copyright 2001, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-tacacs.c,v 1.20 2002/01/21 23:35:32 guy Exp $
+ * $Id: packet-tacacs.c,v 1.21 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -151,7 +151,7 @@ dissect_tacacs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
ti = proto_tree_add_protocol_format(tree, proto_tacacs,
- tvb, 0, tvb_length(tvb), version==0?"TACACS":"XTACACS");
+ tvb, 0, -1, version==0?"TACACS":"XTACACS");
tacacs_tree = proto_item_add_subtree(ti, ett_tacacs);
proto_tree_add_uint(tacacs_tree, hf_tacacs_version, tvb, 0, 1,
@@ -353,7 +353,7 @@ dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
ti = proto_tree_add_protocol_format(tree, proto_tacplus,
- tvb, 0, tvb_length(tvb), "TACACS+");
+ tvb, 0, -1, "TACACS+");
tacplus_tree = proto_item_add_subtree(ti, ett_tacplus);
if (pinfo->match_port == pinfo->destport)
diff --git a/packet-telnet.c b/packet-telnet.c
index 5296595f7b..846af252bb 100644
--- a/packet-telnet.c
+++ b/packet-telnet.c
@@ -2,7 +2,7 @@
* Routines for telnet packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-telnet.c,v 1.28 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-telnet.c,v 1.29 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -377,8 +377,7 @@ dissect_telnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int data_len;
gint iac_offset;
- ti = proto_tree_add_item(tree, proto_telnet, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_telnet, tvb, offset, -1, FALSE);
telnet_tree = proto_item_add_subtree(ti, ett_telnet);
/*
diff --git a/packet-tftp.c b/packet-tftp.c
index bc7df10c85..7304ae5ebf 100644
--- a/packet-tftp.c
+++ b/packet-tftp.c
@@ -5,7 +5,7 @@
* Craig Newell <CraigN@cheque.uq.edu.au>
* RFC2347 TFTP Option Extension
*
- * $Id: packet-tftp.c,v 1.35 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-tftp.c,v 1.36 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -143,8 +143,7 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
- ti = proto_tree_add_item(tree, proto_tftp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_tftp, tvb, offset, -1, FALSE);
tftp_tree = proto_item_add_subtree(ti, ett_tftp);
proto_tree_add_uint(tftp_tree, hf_tftp_opcode, tvb,
@@ -220,8 +219,8 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
if (tree) {
- proto_tree_add_text(tftp_tree, tvb, offset, tvb_length_remaining(tvb, offset),
- "Data (%d bytes)", tvb_length_remaining(tvb, offset));
+ proto_tree_add_text(tftp_tree, tvb, offset, -1,
+ "Data (%d bytes)", tvb_reported_length_remaining(tvb, offset));
}
break;
@@ -266,8 +265,8 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
if (tree) {
- proto_tree_add_text(tftp_tree, tvb, offset, tvb_length_remaining(tvb, offset),
- "Data (%d bytes)", tvb_length_remaining(tvb, offset));
+ proto_tree_add_text(tftp_tree, tvb, offset, -1,
+ "Data (%d bytes)", tvb_reported_length_remaining(tvb, offset));
}
break;
diff --git a/packet-time.c b/packet-time.c
index 89b912c508..900eb23542 100644
--- a/packet-time.c
+++ b/packet-time.c
@@ -3,7 +3,7 @@
*
* Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-time.c,v 1.17 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-time.c,v 1.18 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -55,8 +55,7 @@ dissect_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
- ti = proto_tree_add_item(tree, proto_time, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_time, tvb, 0, -1, FALSE);
time_tree = proto_item_add_subtree(ti, ett_time);
proto_tree_add_text(time_tree, tvb, 0, 0,
diff --git a/packet-tns.c b/packet-tns.c
index 6d0e1e4f0b..d0af57b63c 100644
--- a/packet-tns.c
+++ b/packet-tns.c
@@ -1,7 +1,7 @@
/* packet-tns.c
* Routines for Oracle TNS packet dissection
*
- * $Id: packet-tns.c,v 1.27 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-tns.c,v 1.28 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -177,13 +177,13 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
if ( is_sns )
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Secure Network Services");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Secure Network Services");
}
else
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Data");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Data");
}
data_tree = proto_item_add_subtree(ti, ett_tns_data);
@@ -240,8 +240,8 @@ static void dissect_tns_connect(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( tree )
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Connect");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Connect");
connect_tree = proto_item_add_subtree(ti, ett_tns_connect);
proto_tree_add_boolean_hidden(tns_tree, hf_tns_connect, tvb,
@@ -372,7 +372,7 @@ static void dissect_tns_connect(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
proto_tree_add_item(connect_tree, hf_tns_connect_data, tvb,
tns_offset+cd_offset,
- tvb_length(tvb)-(tns_offset+cd_offset), FALSE);
+ tvb_length_remaining(tvb, tns_offset+cd_offset), FALSE);
}
return;
}
@@ -387,8 +387,8 @@ static void dissect_tns_accept(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( tree )
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Accept");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Accept");
accept_tree = proto_item_add_subtree(ti, ett_tns_accept);
proto_tree_add_boolean_hidden(tns_tree, hf_tns_accept, tvb,
@@ -469,7 +469,7 @@ static void dissect_tns_accept(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
proto_tree_add_item(accept_tree, hf_tns_accept_data, tvb,
tns_offset+accept_offset,
- tvb_length(tvb)-(tns_offset+accept_offset), FALSE);
+ tvb_length_remaining(tvb, tns_offset+accept_offset), FALSE);
}
return;
}
@@ -482,8 +482,8 @@ static void dissect_tns_refuse(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( tree )
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Refuse");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Refuse");
refuse_tree = proto_item_add_subtree(ti, ett_tns_refuse);
proto_tree_add_boolean_hidden(tns_tree, hf_tns_refuse, tvb,
@@ -519,7 +519,7 @@ static void dissect_tns_refuse(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( refuse_tree )
{
proto_tree_add_item(refuse_tree, hf_tns_refuse_data, tvb,
- offset, tvb_length(tvb)-offset, FALSE);
+ offset, tvb_length_remaining(tvb, offset), FALSE);
}
return;
}
@@ -532,8 +532,8 @@ static void dissect_tns_abort(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( tree )
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Abort");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Abort");
abort_tree = proto_item_add_subtree(ti, ett_tns_abort);
proto_tree_add_boolean_hidden(tns_tree, hf_tns_abort, tvb,
@@ -577,13 +577,13 @@ static void dissect_tns_marker(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
if ( is_attention )
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Marker");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Marker");
}
else
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Attention");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Attention");
}
marker_tree = proto_item_add_subtree(ti, ett_tns_marker);
@@ -634,8 +634,8 @@ static void dissect_tns_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( tree )
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Redirect");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Redirect");
redirect_tree = proto_item_add_subtree(ti, ett_tns_redirect);
proto_tree_add_boolean_hidden(tns_tree, hf_tns_redirect, tvb,
@@ -657,7 +657,7 @@ static void dissect_tns_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( redirect_tree )
{
proto_tree_add_item(redirect_tree, hf_tns_redirect_data, tvb,
- offset, tvb_length(tvb)-offset, FALSE);
+ offset, tvb_length_remaining(tvb, offset), FALSE);
}
return;
}
@@ -669,8 +669,8 @@ static void dissect_tns_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( tree )
{
- ti = proto_tree_add_text(tns_tree, tvb, offset,
- tvb_length_remaining(tvb, offset), "Control");
+ ti = proto_tree_add_text(tns_tree, tvb, offset, -1,
+ "Control");
control_tree = proto_item_add_subtree(ti, ett_tns_control);
proto_tree_add_boolean_hidden(tns_tree, hf_tns_control, tvb,
@@ -692,7 +692,7 @@ static void dissect_tns_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( control_tree )
{
proto_tree_add_item(control_tree, hf_tns_control_data, tvb,
- offset, tvb_length(tvb)-offset, FALSE);
+ offset, tvb_length_remaining(tvb, offset), FALSE);
}
return;
}
@@ -718,19 +718,18 @@ dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
- ti = proto_tree_add_item(tree, proto_tns, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_tns, tvb, 0, -1, FALSE);
tns_tree = proto_item_add_subtree(ti, ett_tns);
if (pinfo->match_port == pinfo->destport)
{
proto_tree_add_boolean_hidden(tns_tree, hf_tns_request,
- tvb, offset, tvb_length(tvb), TRUE);
+ tvb, offset, 0, TRUE);
}
else
{
proto_tree_add_boolean_hidden(tns_tree, hf_tns_response,
- tvb, offset, tvb_length(tvb), TRUE);
+ tvb, offset, 0, TRUE);
}
}
diff --git a/packet-ucp.c b/packet-ucp.c
index 8f5dbc59a5..735c6478d5 100644
--- a/packet-ucp.c
+++ b/packet-ucp.c
@@ -2,7 +2,7 @@
* Routines for Universal Computer Protocol dissection
* Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
*
- * $Id: packet-ucp.c,v 1.10 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-ucp.c,v 1.11 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1612,8 +1612,7 @@ dissect_ucp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
/* create display subtree for the protocol */
- ti = proto_tree_add_item(tree, proto_ucp, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ucp, tvb, 0, -1, FALSE);
ucp_tree = proto_item_add_subtree(ti, ett_ucp);
/*
diff --git a/packet-vrrp.c b/packet-vrrp.c
index 1247b2f7e1..f9382c991c 100644
--- a/packet-vrrp.c
+++ b/packet-vrrp.c
@@ -4,7 +4,7 @@
*
* Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-vrrp.c,v 1.20 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-vrrp.c,v 1.21 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -115,8 +115,7 @@ dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 cksum, computed_cksum;
guint8 auth_buf[VRRP_AUTH_DATA_LEN+1];
- ti = proto_tree_add_item(tree, proto_vrrp, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_vrrp, tvb, 0, -1, FALSE);
vrrp_tree = proto_item_add_subtree(ti, ett_vrrp);
tv = proto_tree_add_uint_format(vrrp_tree, hf_vrrp_ver_type,
diff --git a/packet-vtp.c b/packet-vtp.c
index 0dc9bba95e..5c555c05f8 100644
--- a/packet-vtp.c
+++ b/packet-vtp.c
@@ -1,7 +1,7 @@
/* packet-vtp.c
* Routines for the disassembly of Cisco's Virtual Trunking Protocol
*
- * $Id: packet-vtp.c,v 1.18 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-vtp.c,v 1.19 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -107,8 +107,8 @@ dissect_vtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Virtual Trunking Protocol");
if (tree) {
- ti = proto_tree_add_item(tree, proto_vtp, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_vtp, tvb, offset, -1,
+ FALSE);
vtp_tree = proto_item_add_subtree(ti, ett_vtp);
proto_tree_add_item(vtp_tree, hf_vtp_version, tvb, offset, 1,
diff --git a/packet-wccp.c b/packet-wccp.c
index 6a5f4882d8..8fda2d4c2d 100644
--- a/packet-wccp.c
+++ b/packet-wccp.c
@@ -2,7 +2,7 @@
* Routines for Web Cache Coordination Protocol dissection
* Jerry Talkington <jerryt@netapp.com>
*
- * $Id: packet-wccp.c,v 1.26 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-wccp.c,v 1.27 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -218,7 +218,7 @@ dissect_wccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(tree != NULL) {
wccp_tree_item = proto_tree_add_item(tree, proto_wccp, tvb, offset,
- tvb_length(tvb), FALSE);
+ -1, FALSE);
wccp_tree = proto_item_add_subtree(wccp_tree_item, ett_wccp);
proto_tree_add_uint(wccp_tree, hf_wccp_message_type, tvb, offset,
diff --git a/packet-who.c b/packet-who.c
index 26d7179fd0..5f926ed7f3 100644
--- a/packet-who.c
+++ b/packet-who.c
@@ -2,7 +2,7 @@
* Routines for who protocol (see man rwhod)
* Gilbert Ramirez <gram@alumni.rice.edu>
*
- * $Id: packet-who.c,v 1.22 2002/01/21 07:36:47 guy Exp $
+ * $Id: packet-who.c,v 1.23 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -112,8 +112,8 @@ dissect_who(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ts.nsecs = 0;
if (tree) {
- who_ti = proto_tree_add_item(tree, proto_who, tvb, offset,
- tvb_length(tvb), FALSE);
+ who_ti = proto_tree_add_item(tree, proto_who, tvb, offset, -1,
+ FALSE);
who_tree = proto_item_add_subtree(who_ti, ett_who);
}
diff --git a/packet-wsp.c b/packet-wsp.c
index d1069c28f4..b19d7e2a65 100644
--- a/packet-wsp.c
+++ b/packet-wsp.c
@@ -2,7 +2,7 @@
*
* Routines to dissect WSP component of WAP traffic.
*
- * $Id: packet-wsp.c,v 1.51 2002/01/21 07:36:47 guy Exp $
+ * $Id: packet-wsp.c,v 1.52 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1039,8 +1039,8 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
if (tree) {
- ti = proto_tree_add_item(tree, proto_wsp, tvb, 0,
- tvb_length(tvb), bo_little_endian);
+ ti = proto_tree_add_item(tree, proto_wsp, tvb, 0, -1,
+ bo_little_endian);
wsp_tree = proto_item_add_subtree(ti, ett_wsp);
/* Code to process the packet goes here */
diff --git a/packet-wtls.c b/packet-wtls.c
index d3a127826c..e7407fce77 100644
--- a/packet-wtls.c
+++ b/packet-wtls.c
@@ -2,7 +2,7 @@
*
* Routines to dissect WTLS component of WAP traffic.
*
- * $Id: packet-wtls.c,v 1.17 2002/01/21 07:36:47 guy Exp $
+ * $Id: packet-wtls.c,v 1.18 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -367,10 +367,10 @@ dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
ti = proto_tree_add_item(tree, proto_wtls, tvb, offset_wtls,
- tvb_length(tvb), bo_little_endian);
+ -1, bo_little_endian);
wtls_tree = proto_item_add_subtree(ti, ett_wtls);
- for (offset_wtls=0; offset_wtls < (tvb_length(tvb)-1);) {
+ for (offset_wtls=0; offset_wtls < (tvb_reported_length(tvb)-1);) {
pdut = tvb_get_guint8 (tvb, offset_wtls);
offset = offset_wtls+1;
@@ -384,7 +384,7 @@ dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
count += offset-offset_wtls;
}
else {
- count = tvb_length (tvb)-offset_wtls;
+ count = tvb_length_remaining (tvb, offset_wtls);
}
ti = proto_tree_add_uint(wtls_tree, hf_wtls_record, tvb, offset_wtls,
count, pdut);
@@ -411,7 +411,7 @@ dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset+=2;
}
else {
- count = tvb_length (tvb)-offset;
+ count = tvb_length_remaining (tvb, offset);
}
if (pdut & WTLS_RECORD_TYPE_CIPHER_CUR) {
diff --git a/packet-x11.c b/packet-x11.c
index cde3a5259a..d7394f4341 100644
--- a/packet-x11.c
+++ b/packet-x11.c
@@ -2,7 +2,7 @@
* Routines for X11 dissection
* Copyright 2000, Christophe Tronche <ch.tronche@computer.org>
*
- * $Id: packet-x11.c,v 1.28 2002/01/21 07:36:48 guy Exp $
+ * $Id: packet-x11.c,v 1.29 2002/01/24 09:20:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2853,8 +2853,7 @@ dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
if (!tree) return;
- ti = proto_tree_add_item(tree, proto_x11, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
x11_tree = proto_item_add_subtree(ti, ett_x11);
cur_offset = 0;
@@ -2880,8 +2879,7 @@ dissect_x11_event(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
if (tree) {
- ti = proto_tree_add_item(tree, proto_x11, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_x11, tvb, 0, -1, FALSE);
x11_tree = proto_item_add_subtree(ti, ett_x11);
/* Code to process the packet goes here */
diff --git a/packet-x25.c b/packet-x25.c
index f0869212bb..3e0dfaee08 100644
--- a/packet-x25.c
+++ b/packet-x25.c
@@ -2,7 +2,7 @@
* Routines for x25 packet disassembly
* Olivier Abad <oabad@cybercable.fr>
*
- * $Id: packet-x25.c,v 1.63 2002/01/21 07:36:48 guy Exp $
+ * $Id: packet-x25.c,v 1.64 2002/01/24 09:20:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1514,8 +1514,8 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
col_set_str(pinfo->cinfo, COL_INFO, "Invalid/short X.25 packet");
if (tree)
- proto_tree_add_protocol_format(tree, proto_x25, tvb, 0,
- tvb_length(tvb), "Invalid/short X.25 packet");
+ proto_tree_add_protocol_format(tree, proto_x25, tvb, 0, -1,
+ "Invalid/short X.25 packet");
return;
}
@@ -1579,8 +1579,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 prt_id;
if (x25_tree) {
- ti = proto_tree_add_text(x25_tree, tvb, localoffset,
- tvb_length_remaining(tvb, localoffset),
+ ti = proto_tree_add_text(x25_tree, tvb, localoffset, -1,
"User data");
userdata_tree = proto_item_add_subtree(ti, ett_x25_user_data);
}
@@ -1782,8 +1781,8 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (localoffset < tvb_length(tvb)) {
if (userdata_tree) {
- proto_tree_add_text(userdata_tree, tvb, localoffset,
- tvb_length(tvb)-localoffset, "Data");
+ proto_tree_add_text(userdata_tree, tvb, localoffset, -1,
+ "Data");
}
localoffset = tvb_length(tvb);
}
diff --git a/packet-yhoo.c b/packet-yhoo.c
index 758118298a..b440a1e44d 100644
--- a/packet-yhoo.c
+++ b/packet-yhoo.c
@@ -2,7 +2,7 @@
* Routines for yahoo messenger packet dissection
* Copyright 1999, Nathan Neulinger <nneul@umr.edu>
*
- * $Id: packet-yhoo.c,v 1.21 2002/01/21 07:36:48 guy Exp $
+ * $Id: packet-yhoo.c,v 1.22 2002/01/24 09:20:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -109,7 +109,6 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *yhoo_tree, *ti;
int offset = 0;
- int length = 0;
if (pinfo->srcport != TCP_PORT_YHOO && pinfo->destport != TCP_PORT_YHOO) {
/* Not the Yahoo port - not a Yahoo Messenger packet. */
@@ -124,8 +123,6 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return FALSE;
}
- length = tvb_length(tvb);
-
if (memcmp(tvb_get_ptr(tvb, offset, 4), "YPNS", 4) != 0 &&
memcmp(tvb_get_ptr(tvb, offset, 4), "YHOO", 4) != 0) {
/* Not a Yahoo Messenger packet. */
@@ -146,8 +143,8 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_yhoo, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_yhoo, tvb, offset, -1,
+ FALSE);
yhoo_tree = proto_item_add_subtree(ti, ett_yhoo);
proto_tree_add_item(yhoo_tree, hf_yhoo_version, tvb,
@@ -187,7 +184,7 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 36;
proto_tree_add_item(yhoo_tree, hf_yhoo_content, tvb,
- offset, length-offset, TRUE);
+ offset, tvb_length_remaining(tvb, offset), TRUE);
}
return TRUE;
diff --git a/packet-yppasswd.c b/packet-yppasswd.c
index 8bc8428235..b7a20b2b94 100644
--- a/packet-yppasswd.c
+++ b/packet-yppasswd.c
@@ -1,7 +1,7 @@
/* packet-yppasswd.c
* Routines for yppasswd dissection
*
- * $Id: packet-yppasswd.c,v 1.4 2001/06/18 02:17:58 guy Exp $
+ * $Id: packet-yppasswd.c,v 1.5 2002/01/24 09:20:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -60,7 +60,7 @@ dissect_yppasswd_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
offset, NULL);
lock_item = proto_tree_add_item(tree, hf_yppasswd_newpw, tvb,
- offset, tvb_length_remaining(tvb, offset), FALSE);
+ offset, -1, FALSE);
lock_tree = proto_item_add_subtree(lock_item, ett_yppasswd_newpw);
diff --git a/packet-zebra.c b/packet-zebra.c
index e9c3549b7a..fbfa4965f5 100644
--- a/packet-zebra.c
+++ b/packet-zebra.c
@@ -3,7 +3,7 @@
*
* Jochen Friedrich <jochen@scram.de>
*
- * $Id: packet-zebra.c,v 1.19 2002/01/21 23:35:32 guy Exp $
+ * $Id: packet-zebra.c,v 1.20 2002/01/24 09:20:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -483,12 +483,11 @@ dissect_zebra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
request? "ZEBRA Request" : "ZEBRA Reply");
}
if (tree) {
- ti = proto_tree_add_item(tree, proto_zebra, tvb, offset,
- tvb_length_remaining(tvb, offset), FALSE);
+ ti = proto_tree_add_item(tree, proto_zebra, tvb, offset, -1,
+ FALSE);
zebra_tree = proto_item_add_subtree(ti, ett_zebra);
proto_tree_add_boolean_hidden(zebra_tree, hf_zebra_request,
- tvb, offset, tvb_length_remaining(tvb, offset),
- request);
+ tvb, offset, 0, request);
for (;;) {
guint8 command;