Fixed the {tethereal,ethereal}_static targets so that the

static binaries have the dissectors provided in the plugins available.

svn path=/trunk/; revision=3665
This commit is contained in:
Ed Warnicke 2001-07-08 21:51:34 +00:00
parent bf877ca5c5
commit de98ec2efa
7 changed files with 115 additions and 40 deletions

View 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 \
*~

View File

@ -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}

View 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 \
*~

View File

@ -13,5 +13,5 @@
#endif
/* Version number of package */
#define VERSION "0.0.3"
#define VERSION "0.0.4"

View 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 */

View 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 \
*~

View 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 */