diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-06-15 03:49:00 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-06-15 03:49:00 +0000 |
commit | 5bb54ca0a900eef13870349b087353116c2f60e4 (patch) | |
tree | da3484a5835ecf78293f109946a67ec6751de1b7 /packet-syslog.c | |
parent | 998fabbd9c8a6cdaa8a4b0f633e325df371d35a5 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2068 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-syslog.c')
-rw-r--r-- | packet-syslog.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packet-syslog.c b/packet-syslog.c index c66eef70d9..192e79ffd0 100644 --- a/packet-syslog.c +++ b/packet-syslog.c @@ -3,7 +3,7 @@ * * Copyright 2000, Gerald Combs <gerald@zing.org> * - * $Id: packet-syslog.c,v 1.2 2000/06/11 15:54:02 gerald Exp $ + * $Id: packet-syslog.c,v 1.3 2000/06/15 03:48:43 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -150,6 +150,8 @@ static void dissect_syslog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) #else static void dissect_syslog(const u_char *pd, int o, frame_data *fd, proto_tree *tree) { + packet_info *pinfo = π + tvbuff_t *tvb = tvb_create_from_top(o); gint pri = -1, lev = -1, fac = -1; gint msg_off = 0, msg_len; gint ellipsis_len = (COL_INFO_LEN - strlen(ELLIPSIS)) - 1; @@ -157,9 +159,6 @@ static void dissect_syslog(const u_char *pd, int o, frame_data *fd, proto_tree * proto_tree *syslog_tree; gchar msg_str[COL_INFO_LEN]; - tvbuff_t *tvb; - packet_info *pinfo = π - tvb = tvb_new_subset(pinfo->compat_top_tvb, o, -1, -1); #endif pinfo->current_proto = "Syslog"; |