summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-04 07:03:07 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-04 07:03:07 +0000
commitc2b1feea055c65f002bd86d4f4dba6b48453e942 (patch)
tree182de17caf9f6b68d2197d3aaa68ce1e8c8fc20e /packet.c
parent5f0fc518c79f381ea86ee3746ef32e96eb606985 (diff)
downloadwireshark-c2b1feea055c65f002bd86d4f4dba6b48453e942.tar.gz
Turn "ethereal_proto_init()" and "ethereal_proto_cleanup()" into
"dissect_init()" and "dissect_cleanup()", in "packet.c", so that we don't duplicate those routines in Ethereal and Tethereal (and so on), and don't have to remember to update N different versions of them if we have to change the way we do one-time initialization and cleanup. svn path=/trunk/; revision=1790
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/packet.c b/packet.c
index 57427e21e9..e539fcb517 100644
--- a/packet.c
+++ b/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.72 2000/04/04 05:37:36 guy Exp $
+ * $Id: packet.c,v 1.73 2000/04/04 07:02:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1037,6 +1037,24 @@ void blank_packetinfo(void)
pi.destport = 0;
}
+/* Do all one-time initialization. */
+void
+dissect_init(void)
+{
+ proto_init();
+ dfilter_init();
+#ifdef HAVE_PLUGINS
+ init_plugins();
+#endif
+}
+
+void
+dissect_cleanup(void)
+{
+ proto_cleanup();
+ dfilter_cleanup();
+}
+
/* Allow protocols to register "init" routines, which are called before
we make a pass through a capture file and dissect all its packets
(e.g., when we read in a new capture file, or run a "filter packets"