Added two new arguments to epan_init() and proto_init() to
authorhagbard <hagbard@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 2 Apr 2001 00:38:36 +0000 (00:38 +0000)
committerhagbard <hagbard@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 2 Apr 2001 00:38:36 +0000 (00:38 +0000)
allow the passing of register_all_protocols() and
register_all_protocol_handoffs() through epan_init() to proto_init().
This allows the removal of the compile time dependence of proto.c
on register.h.  Modified dftest.c, tethereal.c, and gtk/main.c to
use the new style epan_init() and depend on register.h.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3237 f5534014-38df-0310-8fa8-9805f1628bb7

dftest.c
epan/epan.c
epan/epan.h
epan/proto.c
epan/proto.h
gtk/main.c
tethereal.c

index 95d85f59effbc796cb7d78ec5842ab9d1f21c010..7556d773605a909fd52e98bed3d96f93b5cc967f 100644 (file)
--- a/dftest.c
+++ b/dftest.c
@@ -1,6 +1,6 @@
 /* dftest.c.c
  *
- * $Id: dftest.c,v 1.1 2001/02/01 20:21:13 gram Exp $
+ * $Id: dftest.c,v 1.2 2001/04/02 00:38:33 hagbard Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -81,6 +81,7 @@
 #include "prefs.h"
 #include "util.h"
 #include "epan/dfilter/dfilter.h"
+#include "register.h"
 
 packet_info    pi;
 ts_type                timestamp_type = RELATIVE;
@@ -98,7 +99,8 @@ main(int argc, char **argv)
        "-g" flag, as the "-g" flag dumps a list of fields registered
        by the dissectors, and we must do it before we read the preferences,
        in case any dissectors register preferences. */
-       epan_init(PLUGIN_DIR);
+       epan_init(PLUGIN_DIR,register_all_protocols,
+                 register_all_protocol_handoffs);
 
        /* now register the preferences for any non-dissector modules.
        we must do that before we read the preferences as well. */
index a779cb876b4b9dc19c94a9f9caa0892d03197563..407f6aa11b4cbb8696a6da1842810013de7de64b 100644 (file)
@@ -1,6 +1,6 @@
 /* epan.h
  *
- * $Id: epan.c,v 1.9 2001/04/01 22:01:34 hagbard Exp $
+ * $Id: epan.c,v 1.10 2001/04/02 00:38:34 hagbard Exp $
  *
  * Ethereal Protocol Analyzer Library
  *
  * libraries are located.)
  */
 void
-epan_init(const char *plugin_dir)
+epan_init(const char *plugin_dir, void (register_all_protocols)(void),
+         void (register_all_handoffs)(void))
 {
        except_init();
        tvbuff_init();
        frame_data_init();
-       proto_init(plugin_dir);
+       proto_init(plugin_dir,register_all_protocols,register_all_handoffs);
        packet_init();
        dfilter_init();
 }
index 9f94865f2e43bed0d018820e906a1f6a9f5be26b..a2d97585f8dc110d3862a23c885b78490cd9fb12 100644 (file)
@@ -1,6 +1,6 @@
 /* epan.h
  *
- * $Id: epan.h,v 1.5 2001/02/01 20:21:16 gram Exp $
+ * $Id: epan.h,v 1.6 2001/04/02 00:38:34 hagbard Exp $
  *
  * Ethereal Protocol Analyzer Library
  *
@@ -14,7 +14,8 @@
 /* XXX - for now */
 #include "packet.h"
 
-void epan_init(const char *);
+void epan_init(const char * plugindir, void (register_all_protocols)(void),
+              void (register_all_handoffs)(void));
 void epan_cleanup(void);
 void epan_conversation_init(void);
 
index c2f23f2b2d2da3120e0235a661f749dcf175125f..e1e33677d8d15286ddc48293b0fb8ae1a51c162f 100644 (file)
@@ -1,7 +1,7 @@
 /* proto.c
  * Routines for protocol tree
  *
- * $Id: proto.c,v 1.18 2001/04/01 22:50:08 hagbard Exp $
+ * $Id: proto.c,v 1.19 2001/04/02 00:38:34 hagbard Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -42,7 +42,6 @@
 #include "packet.h"
 #include "strutil.h"
 #include "resolv.h"
-#include "register.h"
 #include "plugins.h"
 #include "ipv6-utils.h"
 #include "proto.h"
@@ -164,7 +163,8 @@ gboolean proto_tree_is_visible = FALSE;
 
 /* initialize data structures and register protocols and fields */
 void
-proto_init(const char *plugin_dir)
+proto_init(const char *plugin_dir,void (register_all_protocols)(void),
+          void (register_all_protocol_handoffs)(void))
 {
        static hf_register_info hf[] = {
                { &hf_text_only,
index 42fdd52fc0eb06d8d9776d75beef5fb15e001485..5bf1b2c5d9c4a01c4f98304355ca016863b6ff26 100644 (file)
@@ -1,7 +1,7 @@
 /* proto.h
  * Definitions for protocol display
  *
- * $Id: proto.h,v 1.10 2001/04/01 22:50:08 hagbard Exp $
+ * $Id: proto.h,v 1.11 2001/04/02 00:38:34 hagbard Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -129,7 +129,8 @@ typedef struct field_info {
 #define NullTVB NULL
 
 /* Sets up memory used by proto routines. Called at program startup */
-void proto_init(const char *plugin_dir);
+void proto_init(const char *plugin_dir, void (register_all_protocols)(void),
+               void (register_all_handoffs)(void));
 
 /* Frees memory used by proto routines. Called at program shutdown */
 void proto_cleanup(void);
index c49ef82dfa06f7cba4727b748bccc89293453b21..8b1c6841fed4b272f8a83689185b398c6d7e8671 100644 (file)
@@ -1,6 +1,6 @@
 /* main.c
  *
- * $Id: main.c,v 1.185 2001/03/27 06:48:12 guy Exp $
+ * $Id: main.c,v 1.186 2001/04/02 00:38:36 hagbard Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #include "plugins.h"
 #include "colors.h"
 #include "strutil.h"
+#include "register.h"
 
 packet_info  pi;
 capture_file cfile;
@@ -804,7 +805,7 @@ main(int argc, char *argv[])
      "-G" flag, as the "-G" flag dumps a list of fields registered
      by the dissectors, and we must do it before we read the preferences,
      in case any dissectors register preferences. */
-  epan_init(PLUGIN_DIR);
+  epan_init(PLUGIN_DIR,register_all_protocols,register_all_protocol_handoffs);
 
   /* Now register the preferences for any non-dissector modules.
      We must do that before we read the preferences as well. */
index 086f097cf70ed26630abfda81b617304a6782352..915255b1394f18371a9407c1ee628e2a7c939be7 100644 (file)
@@ -1,6 +1,6 @@
 /* tethereal.c
  *
- * $Id: tethereal.c,v 1.72 2001/03/27 06:48:11 guy Exp $
+ * $Id: tethereal.c,v 1.73 2001/04/02 00:38:33 hagbard Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -93,6 +93,7 @@
 #include "util.h"
 #include "conversation.h"
 #include "plugins.h"
+#include "register.h"
 
 static guint32 firstsec, firstusec;
 static guint32 prevsec, prevusec;
@@ -201,7 +202,7 @@ main(int argc, char *argv[])
      "-G" flag, as the "-G" flag dumps a list of fields registered
      by the dissectors, and we must do it before we read the preferences,
      in case any dissectors register preferences. */
-  epan_init(PLUGIN_DIR);
+  epan_init(PLUGIN_DIR,register_all_protocols,register_all_protocol_handoffs);
 
   /* Now register the preferences for any non-dissector modules.
      We must do that before we read the preferences as well. */