aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-02-24 06:45:14 +0000
committerGuy Harris <guy@alum.mit.edu>2002-02-24 06:45:14 +0000
commitca8f79df3d8d042806e24a70a738bd5c92b2dc90 (patch)
tree8d38b419307a3b72caa6f51744641c2cf2772ce1 /epan/packet.c
parentb767826991ba30b900ae917a290927871bc62976 (diff)
Get rid of "init_all_protocols()"; instead, have a routine
"init_dissection()" which calls "epan_conversation_init()", does the work that "init_all_protocols()" did, and then calls "reassemble_init()", so that the standard sequence of dissection initialization is done in one place, rather than having multiple places call the same sequence of routines. svn path=/trunk/; revision=4797
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/epan/packet.c b/epan/packet.c
index ce3a5fee74..7efceae46d 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.60 2002/02/18 01:08:41 guy Exp $
+ * $Id: packet.c,v 1.61 2002/02/24 06:45:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -81,6 +81,8 @@
#include "plugins.h"
#include "epan_dissect.h"
+#include "../reassemble.h"
+
static gint proto_malformed = -1;
static dissector_handle_t frame_handle = NULL;
static dissector_handle_t data_handle = NULL;
@@ -135,7 +137,7 @@ register_init_routine(void (*func)(void))
init_routines = g_slist_append(init_routines, func);
}
-/* Call all the registered "init" routines. */
+/* Initialize all data structures used for dissection. */
static void
call_init_routine(gpointer routine, gpointer dummy)
{
@@ -145,11 +147,20 @@ call_init_routine(gpointer routine, gpointer dummy)
}
void
-init_all_protocols(void)
+init_dissection(void)
{
+ /* Initialize the table of conversations. */
+ epan_conversation_init();
+
+ /* Initialize protocol-specific variables. */
g_slist_foreach(init_routines, &call_init_routine, NULL);
-}
+ /* Initialize the common data structures for fragment reassembly.
+ Must be done *after* calling init routines, as those routines
+ may free up space for fragments, which they find by using the
+ data structures that "reassemble_init()" frees. */
+ reassemble_init();
+}
/* Allow protocols to register a "cleanup" routine to be
* run after the initial sequential run through the packets.