aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-05-09 10:03:41 +0000
committerGuy Harris <guy@alum.mit.edu>2004-05-09 10:03:41 +0000
commit15af0f656fcd75bfcacb975476aab614e7ed8dd3 (patch)
tree96fab6287a112ff9379ebf012a7a939884b62ec1 /plugins
parentb964421aec471b54755db1ab9ebc768467b6fdd5 (diff)
From Lars Roland: add support for building a libethereal.dll with MSVC:
add a config.nmake option to control whether to build libethereal.dll or not; remove "./wiretap" from PATH to prevent problems due to wrongly-loaded files; build dissector.lib with MSVC; move "print.c" and "ps.c" to the dissector helpers, as "print.c" imports variables from packet-frame.c and packet-data.c, which are in libethereal; move "g711.c" out of the dissector helpers, as they're used only by Ethereal in a tap, not in Tethereal or in any dissector; add a .def file for libethereal; arrange to declare global variables exported from libethereal with "__declspec(dllimport)" when building programs that import those variables; update the NSIS installer. Make the "configure" script define ETH_VAR_IMPORT as "extern". svn path=/trunk/; revision=10834
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mgcp/Makefile.nmake21
-rw-r--r--plugins/mgcp/packet-mgcp.c14
2 files changed, 31 insertions, 4 deletions
diff --git a/plugins/mgcp/Makefile.nmake b/plugins/mgcp/Makefile.nmake
index def2123ad3..91a785222b 100644
--- a/plugins/mgcp/Makefile.nmake
+++ b/plugins/mgcp/Makefile.nmake
@@ -1,18 +1,33 @@
#
-# $Id: Makefile.nmake,v 1.9 2003/11/06 09:05:13 guy Exp $
+# $Id: Makefile.nmake,v 1.10 2004/05/09 10:03:41 guy Exp $
#
include ..\..\config.nmake
+# If you want this plugin to use libethereal.lib instead
+# of the standard plugin api, you have to comment out the next line
+#USE_LIBETHEREAL_LIB=YES
+
############### no need to modify below this line #########
CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
+!IFDEF ENABLE_LIBETHEREAL
+!IFDEF USE_LIBETHEREAL_LIB
+LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
+CFLAGS=/DHAVE_WIN32_LIBETHEREAL_LIB $(CFLAGS)
+!ENDIF
+!ENDIF
+
+!IFNDEF LINK_PLUGIN_WITH
+LINK_PLUGIN_WITH=..\plugin_api.obj
+!ENDIF
+
OBJECTS=packet-mgcp.obj
-mgcp.dll mgcp.exp mgcp.lib : $(OBJECTS) ..\plugin_api.obj
- link -dll /out:mgcp.dll $(OBJECTS) ..\plugin_api.obj \
+mgcp.dll mgcp.exp mgcp.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
+ link -dll /out:mgcp.dll $(OBJECTS) $(LINK_PLUGIN_WITH) \
$(GLIB_LIBS)
clean:
diff --git a/plugins/mgcp/packet-mgcp.c b/plugins/mgcp/packet-mgcp.c
index 25f1e14eb9..79e022256c 100644
--- a/plugins/mgcp/packet-mgcp.c
+++ b/plugins/mgcp/packet-mgcp.c
@@ -2,7 +2,7 @@
* Routines for mgcp packet disassembly
* RFC 2705
*
- * $Id: packet-mgcp.c,v 1.43 2003/12/05 09:25:41 guy Exp $
+ * $Id: packet-mgcp.c,v 1.44 2004/05/09 10:03:41 guy Exp $
*
* Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
*
@@ -29,7 +29,9 @@
#include "config.h"
#endif
+#ifndef HAVE_WIN32_LIBETHEREAL_LIB
#include "plugins/plugin_api.h"
+#endif
#include "moduleinfo.h"
@@ -45,8 +47,11 @@
#include <epan/strutil.h>
#include <epan/conversation.h>
#include "packet-mgcp.h"
+#include "../../tap.h"
+#ifndef HAVE_WIN32_LIBETHEREAL_LIB
#include "plugins/plugin_api_defs.h"
+#endif
#ifndef ENABLE_STATIC
G_MODULE_EXPORT const gchar version[] = VERSION;
@@ -1532,6 +1537,8 @@ plugin_reg_handoff(void){
proto_reg_handoff_mgcp();
}
+#ifndef HAVE_WIN32_LIBETHEREAL_LIB
+
G_MODULE_EXPORT void
plugin_init(plugin_address_table_t *pat
#ifndef PLUGINS_NEED_ADDRESS_TABLE
@@ -1540,6 +1547,11 @@ _U_
){
/* initialise the table of pointers needed in Win32 DLLs */
plugin_address_table_init(pat);
+
+#else /* HAVE_WIN32_LIBETHEREAL_LIB */
+G_MODULE_EXPORT void plugin_init(void *dummy _U_)
+{
+#endif
/* register the new protocol, protocol fields, and subtrees */
if (proto_mgcp == -1) { /* execute protocol initialization only once */
proto_register_mgcp();