diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-08-20 02:16:23 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-08-20 02:16:23 +0000 |
commit | 2962655ac565291f66d4a5271c72bacf8774d4b6 (patch) | |
tree | f741ab678f15738c87d5be18dbf16e85db7c3a57 | |
parent | fe7540783e0b77fa044e4f6767069403ae620f23 (diff) | |
download | wireshark-2962655ac565291f66d4a5271c72bacf8774d4b6.tar.gz |
This is an SMTP dissector, not a BXXP dissector; fix the comment at the
beginning.
Pass "pinfo->fd", not "fd", to "p_get_proto_data()", so that it'll
continue to work even when tvbuffified.
Use "strchr()", not "index()" - "strchr()" is in the ANSI C standard,
and may be in some systems that don't have "index()", whereas those
systems that had "index()" but not "strchr()" got with the ANSI C
program a while ago.
Use "old_dissector_add()" and "old_dissector_delete()" to register and
unregister the SMTP dissector, as it's not yet been tvbuffified.
svn path=/trunk/; revision=2303
-rw-r--r-- | packet-smtp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-smtp.c b/packet-smtp.c index 37d710fd8a..1122380e11 100644 --- a/packet-smtp.c +++ b/packet-smtp.c @@ -1,7 +1,7 @@ /* packet-smtp.c - * Routines for BXXP packet disassembly + * Routines for SMTP packet disassembly * - * $Id: packet-smtp.c,v 1.1 2000/08/19 23:06:51 sharpe Exp $ + * $Id: packet-smtp.c,v 1.2 2000/08/20 02:16:23 guy Exp $ * * Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com> * @@ -103,7 +103,7 @@ dissect_smtp(const u_char *pd, int offset, frame_data *fd, /* Let's figure out this packet ... First check if we have done it all before ... */ - frame_data = p_get_proto_data(fd, proto_smtp); /* FIXME: What about tvb */ + frame_data = p_get_proto_data(pinfo->fd, proto_smtp); /* SMTP messages have a simple format ... */ @@ -111,7 +111,7 @@ dissect_smtp(const u_char *pd, int offset, frame_data *fd, request = pinfo -> destport == TCP_PORT_SMTP; cmd = pd + offset; /* FIXME: What about tvb */ - data = index(cmd, ' '); /* Find the space */ + data = strchr(cmd, ' '); /* Find the space */ if (data) data++; /* Skip the space if there */ } @@ -195,7 +195,7 @@ proto_reg_handoff_smtp(void) if (smtp_prefs_initialized) { - dissector_delete("tcp.port", tcp_port, dissect_smtp); + old_dissector_delete("tcp.port", tcp_port, dissect_smtp); } else { @@ -206,6 +206,6 @@ proto_reg_handoff_smtp(void) tcp_port = global_smtp_tcp_port; - dissector_add("tcp.port", global_smtp_tcp_port, dissect_smtp); + old_dissector_add("tcp.port", global_smtp_tcp_port, dissect_smtp); } |