Fixed the {tethereal,ethereal}_static targets so that the
authorhagbard <hagbard@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 8 Jul 2001 21:51:34 +0000 (21:51 +0000)
committerhagbard <hagbard@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 8 Jul 2001 21:51:34 +0000 (21:51 +0000)
static binaries have the dissectors provided in the plugins available.

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

Makefile.am
make-reg-dotc
plugins/gryphon/Makefile.am
plugins/gryphon/moduleinfo.h
plugins/gryphon/packet-gryphon.c
plugins/mgcp/Makefile.am
plugins/mgcp/packet-mgcp.c

index d272d6c304f6af0a9befa3d370b2c6e6b67b47fc..a0edaecc39ec3bb58aa4559ed861d7617f9c8946 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal
 #
-# $Id: Makefile.am,v 1.343 2001/07/04 06:25:03 girlich Exp $
+# $Id: Makefile.am,v 1.344 2001/07/08 21:51:31 hagbard Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@ethereal.com>
@@ -259,6 +259,10 @@ DISSECTOR_SRC = \
        packet-ypxfr.c \
        packet-zebra.c
 
+PLUGIN_SRC = \
+       plugins/mgcp/packet-mgcp.c      \
+       plugins/gryphon/packet-gryphon.c 
+
 noinst_HEADERS = \
        packet-afs.h   \
        packet-afs-macros.h \
@@ -384,7 +388,6 @@ ETHEREAL_COMMON_SRC = \
        ptvcursor.h     \
        reassemble.c   \
        reassemble.h   \
-       register.c     \
        register.h     \
        smb.h          \
        util.c         \
@@ -401,6 +404,7 @@ BUILT_SOURCES = \
 ethereal_SOURCES = \
        $(DISSECTOR_SRC) \
        $(ETHEREAL_COMMON_SRC) \
+       register.c     \
        capture.c      \
        capture.h      \
        file.c         \
@@ -419,7 +423,25 @@ ethereal_SOURCES = \
        ui_util.h
 
 ethereal_static_SOURCES = \
-       $(ethereal_SOURCES)
+       $(DISSECTOR_SRC) \
+       $(ETHEREAL_COMMON_SRC) \
+       register-static.c     \
+       capture.c      \
+       capture.h      \
+       file.c         \
+       file.h         \
+       filters.c      \
+       filters.h      \
+       globals.h      \
+       menu.h         \
+       progress_dlg.h \
+       proto_hier_stats.h      \
+       proto_hier_stats.c      \
+       simple_dialog.h \
+       statusbar.h    \
+       summary.c      \
+       summary.h      \
+       ui_util.h       
 
 EXTRA_ethereal_SOURCES = \
        snprintf.c      \
@@ -482,10 +504,12 @@ ethereal_LDADD = \
 
 ethereal_static_LDADD = \
        "-all-static"                   \
+       plugins/mgcp/packet-mgcp-static.o               \
+       plugins/gryphon/packet-gryphon-static.o         \
        $(ethereal_optional_objects)    \
        $(ethereal_additional_libs)     \
        @SNMP_LIBS@ @SSL_LIBS@          \
-       @PCAP_LIBS@ @GTK_LIBS@
+       @PCAP_LIBS@ @GTK_LIBS@          
 
 ethereal_LDFLAGS = -export-dynamic
 ethereal_static_LDFLAGS = -Wl,-static
@@ -493,10 +517,14 @@ ethereal_static_LDFLAGS = -Wl,-static
 tethereal_SOURCES = \
        $(DISSECTOR_SRC) \
        $(ETHEREAL_COMMON_SRC) \
+       register.c     \
        tethereal.c
 
 tethereal_static_SOURCES = \
-       $(tethereal_SOURCES)
+       $(DISSECTOR_SRC) \
+       $(ETHEREAL_COMMON_SRC) \
+       register-static.c     \
+       tethereal.c
 
 # Additional libs that I know how to build. These will be
 # linked into the tethereal executable.
@@ -529,6 +557,8 @@ tethereal_LDADD = wiretap/libwiretap.a      \
 
 tethereal_static_LDADD = \
        "-all-static"           \
+       plugins/mgcp/packet-mgcp-static.o               \
+       plugins/gryphon/packet-gryphon-static.o         \
        wiretap/libwiretap.a    \
        $(ethereal_optional_objects)    \
        $(tethereal_additional_libs)    \
@@ -582,7 +612,11 @@ x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
 #
 register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
        @echo Making register.c
-       @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SRC)
+       @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
+
+register-static.c: $(PLUGIN_SRC) $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
+       @echo Making register-static.c
+       @$(srcdir)/make-reg-dotc register-static.c $(srcdir) $(PLUGIN_SRC) $(DISSECTOR_SRC)
 
 ps.c: print.ps rdps
        ./rdps $(srcdir)/print.ps ps.c
@@ -600,6 +634,7 @@ randpkt: randpkt.o wiretap/libwiretap.a
 dftest_SOURCES = \
        $(DISSECTOR_SRC) \
        $(ETHEREAL_COMMON_SRC) \
+       register.c     \
        dftest.c
 
 dftest_additional_libs =               \
@@ -627,6 +662,7 @@ dftest_LDFLAGS = -export-dynamic
 
 DISTCLEANFILES =       \
        register.c      \
+       register-static.c \
        rdps            \
        ps.c            \
        *~
index 2c70aefba76ca12de4d5500d611c84e094724490..bfa35984fe73baa4a4284e2343ecfc8109443cce 100755 (executable)
@@ -1,7 +1,14 @@
 #! /bin/sh
 
 #
-# The first argument is the directory in which the source files live.
+# The first argument is the output filename.
+#
+
+outfile="$1"
+shift
+
+#
+# The second argument is the directory in which the source files live.
 #
 srcdir="$1"
 shift
@@ -9,15 +16,15 @@ shift
 #
 # All subsequent arguments are the files to scan.
 #
-rm -f register.c-tmp
-echo '/* Do not modify this file.  */' >register.c-tmp
-echo '/* It is created automatically by the Makefile.  */'>>register.c-tmp
+rm -f ${outfile}-tmp
+echo '/* Do not modify this file.  */' >${outfile}-tmp
+echo '/* It is created automatically by the Makefile.  */'>>${outfile}-tmp
 echo '#include "register.h"' >>register.c-tmp
 
 #
 # Build code to call all the protocol registration routines.
 #
-echo 'void register_all_protocols(void) {' >>register.c-tmp
+echo 'void register_all_protocols(void) {' >>${outfile}-tmp
 for f in "$@"
 do
        if [ -f $f ]
@@ -27,7 +34,7 @@ do
                srcfile=$srcdir/$f
        fi
        grep '^proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
-done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>register.c-tmp
+done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
 for f in "$@"
 do
        if [ -f $f ]
@@ -37,13 +44,13 @@ do
                srcfile=$srcdir/$f
        fi
        grep '^void proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
-done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>register.c-tmp
-echo '}' >>register.c-tmp
+done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
+echo '}' >>${outfile}-tmp
 
 #
 # Build code to call all the protocol handoff registration routines.
 #
-echo 'void register_all_protocol_handoffs(void) {' >>register.c-tmp
+echo 'void register_all_protocol_handoffs(void) {' >>${outfile}-tmp
 for f in "$@"
 do
        if [ -f $f ]
@@ -53,7 +60,7 @@ do
                srcfile=$srcdir/$f
        fi
        grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
-done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>register.c-tmp
+done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
 for f in "$@"
 do
        if [ -f $f ]
@@ -63,6 +70,6 @@ do
                srcfile=$srcdir/$f
        fi
        grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
-done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>register.c-tmp
-echo '}' >>register.c-tmp
-mv register.c-tmp register.c
+done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
+echo '}' >>${outfile}-tmp
+mv ${outfile}-tmp ${outfile}
index b464e34826776f0b56ab01d4d0fc4248bf38c032..eb4f77b53b73ce7e90dbd9fe72a5f7a4adf90570 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal/Gryphon
 #
-# $Id: Makefile.am,v 1.6 2000/03/03 12:01:22 gram Exp $
+# $Id: Makefile.am,v 1.7 2001/07/08 21:51:32 hagbard Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Steve Limkemann <stevelim@dgtech.com>
@@ -36,6 +36,11 @@ gryphon_la_LDFLAGS = -module -avoid-version
 # add them here.
 LIBS =
 
+noinst_PROGRAMS = packet-gryphon-static.o
+
+packet-gryphon-static.o:       packet-gryphon.c moduleinfo.h
+       $(LTCOMPILE) -c -o packet-gryphon-static.o -D__ETHEREAL_STATIC__ packet-gryphon.c
+
 CLEANFILES = \
        gryphon \
        *~
index 0f8e458a07621c2bd1a87194dc6c305f5bc80270..b29fa047a5a7e34aa3a22cbaa116abfad275c938 100644 (file)
@@ -13,5 +13,5 @@
 #endif
 
 /* Version number of package */
-#define VERSION "0.0.3"
+#define VERSION "0.0.4"
 
index 8ed36992f4298cf0d2054c8d31fc1c6ec29e2f6b..7355dc18374ff3ef55425f0d51b571655d6018f3 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-gryphon.c
  * Routines for Gryphon protocol packet disassembly
  *
- * $Id: packet-gryphon.c,v 1.22 2001/06/18 02:18:25 guy Exp $
+ * $Id: packet-gryphon.c,v 1.23 2001/07/08 21:51:32 hagbard Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Steve Limkemann <stevelim@dgtech.com>
@@ -48,7 +48,9 @@
 #include "packet.h"
 #include "packet-gryphon.h"
 
+#ifndef __ETHEREAL_STATIC__
 G_MODULE_EXPORT const gchar version[] = VERSION;
+#endif
 
 #ifndef G_HAVE_GINT64
 #error "Sorry, this won't compile without 64-bit integer support"
@@ -1816,8 +1818,8 @@ blm_mode(tvbuff_t *tvb, int offset, int src, int msglen, proto_tree *pt)
     return offset;
 }
 
-G_MODULE_EXPORT void
-plugin_init(plugin_address_table_t *pat)
+void
+proto_register_gryphon(void)
 {
     static hf_register_info hf[] = {
        { &hf_gryph_src,
@@ -1859,22 +1861,32 @@ plugin_init(plugin_address_table_t *pat)
        &ett_gryphon_pgm_status,
        &ett_gryphon_pgm_options,
     };
-    plugin_address_table_init(pat);
-    if (proto_gryphon == -1) {
-       /* first activation */
-       proto_gryphon = proto_register_protocol("DG Gryphon Protocol",
-                                               "Gryphon",
-                                               "gryphon");
-       proto_register_field_array(proto_gryphon, hf, array_length(hf));
-       proto_register_subtree_array(ett, array_length(ett));
-    } else {
-       /* do nothing, this is in fact a re-activation with possibly 
-          a new filter */
-    }
+    proto_gryphon = proto_register_protocol("DG Gryphon Protocol",
+                                           "Gryphon",
+                                           "gryphon");
+    proto_register_field_array(proto_gryphon, hf, array_length(hf));
+    proto_register_subtree_array(ett, array_length(ett));
 }
 
-G_MODULE_EXPORT void
-plugin_reg_handoff(void)
+void
+proto_reg_handoff_gryphon(void)
 {
     dissector_add("tcp.port", 7000, &dissect_gryphon, proto_gryphon);
 }
+
+/* Start the functions we need for the plugin stuff */
+G_MODULE_EXPORT void
+plugin_reg_handoff(void){
+  proto_reg_handoff_gryphon();
+}
+
+G_MODULE_EXPORT void
+plugin_init(plugin_address_table_t *pat){
+  /* initialise the table of pointers needed in Win32 DLLs */
+  plugin_address_table_init(pat);
+  /* register the new protocol, protocol fields, and subtrees */
+  if (proto_gryphon == -1) { /* execute protocol initialization only once */
+    proto_register_gryphon();
+  }
+}
+/* End the functions we need for plugin stuff */
index dd83cc8ee82a8ae0f214c0b5187073866a8af12f..52e56f997b175138e925748f62a8e68cbcef915f 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal/Gryphon
 #
-# $Id: Makefile.am,v 1.1 2000/11/09 10:04:48 gram Exp $
+# $Id: Makefile.am,v 1.2 2001/07/08 21:51:33 hagbard Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Steve Limkemann <stevelim@dgtech.com>
@@ -36,6 +36,11 @@ mgcp_la_LDFLAGS = -module -avoid-version
 # add them here.
 LIBS =
 
+noinst_PROGRAMS = packet-mgcp-static.o
+
+packet-mgcp-static.o:  packet-mgcp.c moduleinfo.h
+       $(LTCOMPILE) -c -o packet-mgcp-static.o -D__ETHEREAL_STATIC__ packet-mgcp.c 
+
 CLEANFILES = \
        mgcp \
        *~
index 46152aaaf3768a0b0ed71e155c7a1e4a7ad3d1fd..5dcdd294f462a26823b2afddf4f6ace693438c72 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for mgcp packet disassembly
  * RFC 2705
  *
- * $Id: packet-mgcp.c,v 1.25 2001/07/08 04:47:33 hagbard Exp $
+ * $Id: packet-mgcp.c,v 1.26 2001/07/08 21:51:34 hagbard Exp $
  * 
  * Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
  *
@@ -51,7 +51,9 @@
 #include "prefs.h"
 #include "strutil.h"
 
+#ifndef __ETHEREAL_STATIC__
 G_MODULE_EXPORT const gchar version[] = VERSION;
+#endif
 
 #define TCP_PORT_MGCP_GATEWAY 2427
 #define UDP_PORT_MGCP_GATEWAY 2427
@@ -1248,6 +1250,9 @@ static gint tvb_find_dot_line(tvbuff_t* tvb, gint offset,
 }
 
 /* Start the functions we need for the plugin stuff */
+
+#ifndef __ETHEREAL_STATIC__
+
 G_MODULE_EXPORT void
 plugin_reg_handoff(void){
   proto_reg_handoff_mgcp();
@@ -1262,4 +1267,9 @@ plugin_init(plugin_address_table_t *pat){
     proto_register_mgcp();
   }
 }
+
+#endif
+
 /* End the functions we need for plugin stuff */
+
+