aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smtp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-03 04:00:26 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-03 04:00:26 +0000
commitbced8711f67b5dba76e9d6cdfd1a0246b235df27 (patch)
tree6303e298a7b136a1e1da306950398c99e3e71432 /packet-smtp.c
parent8d0ea8bc932de5cf57183a593be160515af064d9 (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. svn path=/trunk/; revision=4308
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);
}