aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smtp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-12-03 04:00:26 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-12-03 04:00:26 +0000
commitb6afcc102f8ba453034eda35648ff746ed329f4a (patch)
tree6303e298a7b136a1e1da306950398c99e3e71432 /packet-smtp.c
parentcc6c7a4721cbfeee3556dacd8f019d9cc78ef293 (diff)
Make "dissector_add()", "dissector_delete()", and "dissector_change()"
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4308 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-smtp.c')
-rw-r--r--packet-smtp.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/packet-smtp.c b/packet-smtp.c
index cb0d26dbd3..a242785258 100644
--- a/packet-smtp.c
+++ b/packet-smtp.c
@@ -1,13 +1,14 @@
/* packet-smtp.c
* Routines for SMTP packet disassembly
*
- * $Id: packet-smtp.c,v 1.21 2001/11/13 04:34:38 guy Exp $
+ * $Id: packet-smtp.c,v 1.22 2001/12/03 03:59:39 guy Exp $
*
* Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com>
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1999 Gerald Combs
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -521,21 +522,24 @@ void
proto_reg_handoff_smtp(void)
{
static int smtp_prefs_initialized = FALSE;
+ static dissector_handle_t smtp_handle;
static int tcp_port = 0;
- if (smtp_prefs_initialized) {
+ if (!smtp_prefs_initialized) {
+
+ smtp_handle = create_dissector_handle(dissect_smtp, proto_smtp);
- dissector_delete("tcp.port", tcp_port, dissect_smtp);
+ smtp_prefs_initialized = TRUE;
}
else {
- smtp_prefs_initialized = TRUE;
+ dissector_delete("tcp.port", tcp_port, smtp_handle);
}
tcp_port = global_smtp_tcp_port;
- dissector_add("tcp.port", global_smtp_tcp_port, dissect_smtp, proto_smtp);
+ dissector_add("tcp.port", global_smtp_tcp_port, smtp_handle);
}