Wireshark-dev: Re: [Wireshark-dev] What are nmake commands required to builddissector

From: "Hal Lander" <hal_lander@xxxxxxxxxxx>
Date: Tue, 14 Nov 2006 05:48:21 -0900
That was a big help.
To use a plugin dll is the only thing required that the dll file is in wireshark-gtk2\plugins\0.99.4 ?

The toplevel Makefile.nmake seems to explicitly copy each plugin, and I could edit the nmake file to include mine, but I want to be sure I am not missing something else.

The toplevel Makefile.nmake has a section near the bottom which does the copies, here is an extract;

if not exist $(INSTALL_DIR)\plugins\$(VERSION) mkdir $(INSTALL_DIR)\plugins\$(VERSION)
	xcopy ".\plugins\acn\acn.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
	xcopy ".\plugins\agentx\agentx.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
	xcopy ".\plugins\artnet\artnet.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
	xcopy ".\plugins\asn1\asn1.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
	xcopy ".\plugins\ciscosm\ciscosm.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
	xcopy ".\plugins\docsis\docsis.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
	xcopy ".\plugins\enttec\enttec.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
xcopy ".\plugins\giop\coseventcomm.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d

Hal


From: "Bill Florac" <bill.florac@xxxxxxxxxxxxxx>
Reply-To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
To: "Developer support list for Wireshark" <wireshark-dev@xxxxxxxxxxxxx>
Subject: Re: [Wireshark-dev] What are nmake commands required to builddissector
Date: Mon, 13 Nov 2006 14:12:20 -0600

If you are building on 0.99.4 the DON'T cut and hack the make file.
Simply edit the Makefile.common file by adding your plug-in name at the
top and putting the source and includes where indicated:
--------------------------------
# the name of the plugin
PLUGIN_NAME = foo

# the dissector sources (without any helpers)
DISSECTOR_SRC =           \
	foo.c

# corresponding headers
DISSECTOR_INCLUDES =	  \
	foo.h
--------------------------------

You then should modify the moduleinfo.h file replacing the define for
yours. You might also want to adjust the version (shows up in About):
--------------------------------
#define PACKAGE "foo"
#define VERSION "0.0.1"
--------------------------------

You can also modify the AUTHORS and ChangeLog files:
--------------------------------
Authors :
Hal Lander <hlander@xxxxxxxxxxxxxxx>
--------------------------------

Compile the file from the same directory as the plugin (foo)
Here is the batch file I call from my editor
--------------------------------
@echo off
call VCVARS32.BAT
echo Make...
nmake -f Makefile.nmake
echo.
if not errorlevel 1 goto pass1
echo
************************************************************************
********
goto done
:pass1
echo Make OK
echo Copy...
copy /y foo.dll ..\0.99.4\foo.dll > nul
if not errorlevel 1 goto pass2
echo
************************************************************************
********
goto done
:pass2
echo Copy OK
:done
--------------------------------

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Hal Lander
Sent: Monday, November 13, 2006 9:13 AM
To: wireshark-dev@xxxxxxxxxxxxx
Subject: [Wireshark-dev] What are nmake commands required to build
dissector

I have cut an pasted the Windows Makefile.nmake below from the developer
guide.
My dissector is the sample one from the guide, and I have stuck with the
name foo.
I think I have followed the edits in README.plugins correctly, but I am
not familiar with nmake and I get lost at section 4.

My questions are;
1. What command do I type at the command line to build the dissector
dll, and which directory should I be in when I type it ( I only want to
build the disssector as a plugin, I have built Wireshark from the source
and it works). ?
2. To get Wireshark to use the new dissector do I just need to put the
dll where the other dissector dlls are i.e. in
wireshark-gtk2\plugins\0.99.4 ?

TIA
Hal

include ..\..\config.nmake
############### no need to modify below this line #########
CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
!IFDEF ENABLE_LIBWIRESHARK
LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib
CFLAGS=/DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
OBJECTS=foo.obj
foo.dll foo.exp foo.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
link -dll /out:foo.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
$(GLIB_LIBS)
!ENDIF
clean:
rm -f $(OBJECTS) foo.dll foo.exp foo.lib *.pdb
distclean: clean
maintainer-clean: distclean

_________________________________________________________________
Find a local pizza place, music store, museum and morethen map the best
route!  http://local.live.com?FORM=MGA001

_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev

_________________________________________________________________
Stay in touch with old friends and meet new ones with Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us