aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x11.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-06-15 03:49:00 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-06-15 03:49:00 +0000
commit0ab8dd8cbd69bcafc65f2a24d02f9976f8bb90be (patch)
treeda3484a5835ecf78293f109946a67ec6751de1b7 /packet-x11.c
parentadaefea44d13402f406a73f7ca64a3dd9030141e (diff)
Convert IPX-and-friend dissectors in packet-ipx.c to use
tvbuffs. In doing so, I realied that my recommendation for using tvb_new_subset(pi.compat_top_tvb, -1, -1) was incorrect, because some dissectors (ethernet!) change pi.len and pi.cap_len. So, I have to take those two variables into account instead of using -1 and -1. So, I provide a macro called tvb_create_from_top(offset), where offset is the name of your offset variable. It is a wrapper around tvb_new_subset(). I converted the lines that followed my suggestion to use tvb_create_from_top(). In proto.c I added proto_tree_add_debug_text(proto_tree*, const char*, ...) It's much like proto_tree_add_text(), except that it takes no offset or length; it's soley for temporarily putting debug text into the proto_tree while debugging a dissector. In making sure that its use is temporary, the funciton also prints the debug string to stdout to remind the programmer that the debug code needs to be removed before shipping the code. svn path=/trunk/; revision=2068
Diffstat (limited to 'packet-x11.c')
-rw-r--r--packet-x11.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/packet-x11.c b/packet-x11.c
index fde73bf5f3..ec63cb2743 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.6 2000/06/14 07:16:07 guy Exp $
+ * $Id: packet-x11.c,v 1.7 2000/06/15 03:48:43 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -2869,7 +2869,7 @@ dissect_x11_request(const u_char *pd, int offset, frame_data *fd, proto_tree *tr
/* Code to process the packet goes here */
- tvb = tvb_new_subset(pi.compat_top_tvb, offset, -1, -1);
+ tvb = tvb_create_from_top(offset);
cur_offset = 0;
little_endian = guess_byte_ordering(tvb);
left = dissect_x11_request_loop(x11_tree);
@@ -2919,6 +2919,7 @@ dissect_x11_event(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
static void
dissect_x11(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
+ pi.current_proto = "X11";
if (pi.destport == TCP_PORT_X11 || pi.destport == TCP_PORT_X11_2 || pi.destport == TCP_PORT_X11_3)
dissect_x11_request(pd, offset, fd, tree);
else