aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smtp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-01-25 06:14:14 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-01-25 06:14:14 +0000
commitd6703cb426bce30ebc61f4b4afe7c0858440500e (patch)
treeb1874a0778b3163345ccecf56d1ae88804b2f7cb /packet-smtp.c
parent3aaaefdd5c4f70166fc76793d24450c8b1fd21a0 (diff)
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.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2938 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-smtp.c')
-rw-r--r--packet-smtp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-smtp.c b/packet-smtp.c
index ae4ca6e633..3ad8e2be84 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.14 2001/01/09 06:31:43 guy Exp $
+ * $Id: packet-smtp.c,v 1.15 2001/01/25 06:14:14 guy Exp $
*
* Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com>
*
@@ -174,10 +174,6 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean is_continuation_line;
int cmdlen;
- CHECK_DISPLAY_AS_DATA(proto_smtp, tvb, pinfo, tree);
-
- pinfo->current_proto = "SMTP";
-
/* As there is no guarantee that we will only see frames in the
* the SMTP conversation once, and that we will see them in
* order - in Ethereal, the user could randomly click on frames
@@ -204,10 +200,14 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* SMTP messages have a simple format ... */
- request = pinfo -> destport == TCP_PORT_SMTP;
+ request = pinfo -> destport == pinfo -> match_port;
/*
* Get the first line from the buffer.
+ *
+ * Note that "tvb_find_line_end()" will return a value that
+ * is not longer than what's in the buffer, so the
+ * "tvb_get_ptr()" call won't throw an exception.
*/
linelen = tvb_find_line_end(tvb, offset, -1, &next_offset);
line = tvb_get_ptr(tvb, offset, linelen);