aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ipx.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-01-24 09:20:54 +0000
committerGuy Harris <guy@alum.mit.edu>2002-01-24 09:20:54 +0000
commiteb2d6593dca282de10e8dc13a5e2cde4523b800a (patch)
tree72ec8d9d161bf956703a8111d9457fca75745804 /packet-ipx.c
parent6f334976e03a191e5270813a63f6d454df5cb48b (diff)
Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls that add FT_NONE or FT_PROTO items to the protocol tree, with -1. Replace some calls to "tvb_length()" or "tvb_length_remaining()" with calls to "tvb_reported_length()" and "tvb_reported_length_remaining()", as those give the actual length of the data in the packet, not just the data that happened to be captured. svn path=/trunk/; revision=4605
Diffstat (limited to 'packet-ipx.c')
-rw-r--r--packet-ipx.c23
1 files changed, 13 insertions, 10 deletions
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);