diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-01-25 06:14:14 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-01-25 06:14:14 +0000 |
commit | 32d63ecb303df930ec2521c0064c23697c96142d (patch) | |
tree | b1874a0778b3163345ccecf56d1ae88804b2f7cb /packet-sna.c | |
parent | a8649c0e747b150c444b1f7cfa6f7ca82ff4fa3e (diff) | |
download | wireshark-32d63ecb303df930ec2521c0064c23697c96142d.tar.gz wireshark-32d63ecb303df930ec2521c0064c23697c96142d.tar.bz2 wireshark-32d63ecb303df930ec2521c0064c23697c96142d.zip |
Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto ="
statements.
Move the setting of the Protocol column in various dissectors before
anything is fetched from the packet, and also clear the Info column at
that point in those and some other dissectors, so that if an exception
is thrown, the columns don't reflect the previous protocol.
"Tvbuffify" the Mobile IP dissector (it took old-style arguments, and
then converted them into tvbuff arguments, so there wasn't much to do,
other than to fix references to "fd" to refer to "pinfo->fd").
In the SCTP dissector, refer to the port type and source and destination
ports through "pinfo" rather than through the global "pi", as it's a
tvbuffified dissector.
In the SMTP and Time Protocol dissectors, use "pinfo->match_port" rather
than "TCP_PORT_SMTP" when checking whether the packet is a request or
reply, just in case somebody makes a non-standard port be dissected as
SMTP or Time. (Also, remove a bogus comment from the Time dissector; it
was probably cut-and-pasted from the TFTP dissector.)
svn path=/trunk/; revision=2938
Diffstat (limited to 'packet-sna.c')
-rw-r--r-- | packet-sna.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packet-sna.c b/packet-sna.c index a4550cff3c..b36f0e9664 100644 --- a/packet-sna.c +++ b/packet-sna.c @@ -2,7 +2,7 @@ * Routines for SNA * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-sna.c,v 1.24 2001/01/10 04:17:13 gram Exp $ + * $Id: packet-sna.c,v 1.25 2001/01/25 06:14:14 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -327,9 +327,10 @@ dissect_sna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int sna_header_len = 0, th_header_len = 0; int offset; - CHECK_DISPLAY_AS_DATA(proto_sna, tvb, pinfo, tree); - - pinfo->current_proto = "SNA"; + if (check_col(pinfo->fd, COL_PROTOCOL)) + col_set_str(pinfo->fd, COL_PROTOCOL, "SNA"); + if (check_col(pinfo->fd, COL_INFO)) + col_clear(pinfo->fd, COL_INFO); /* SNA data should be printed in EBCDIC, not ASCII */ pinfo->fd->flags.encoding = CHAR_EBCDIC; @@ -338,8 +339,6 @@ dissect_sna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) th_fid = hi_nibble(tvb_get_guint8(tvb, 0)); /* Summary information */ - if (check_col(pinfo->fd, COL_PROTOCOL)) - col_set_str(pinfo->fd, COL_PROTOCOL, "SNA"); if (check_col(pinfo->fd, COL_INFO)) col_add_str(pinfo->fd, COL_INFO, val_to_str(th_fid, sna_th_fid_vals, "Unknown FID: %01x")); |