Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: NTop: Dev

ntop win32-mingw patch and notes

 

 

NTop dev RSS feed   Index | Next | Previous | View Threaded


scott at renfro

Nov 8, 2001, 8:01 PM

Post #1 of 2 (124 views)
Permalink
ntop win32-mingw patch and notes

Enclosed is a patch to ntop-01-11-06.tgz that can be used to build ntop
on win2k with the MinGW compiler suite (gcc linked against the MS
runtime). Since the patch shouldn't interfere with other platforms
(though it does need to be tested under non-mingw32 builds), it may be
worth checking in to the repository.

The remainder of this note describes how to build ntop on win2k using
the MinGW toolchain (MinGW allows you to build native win32 binaries
linked against the Microsoft runtime and not the cygwin runtime).

This was last tested against the 2001-11-06 snapshot from
http://snapshot.ntop.org.

Prerequistes:

1) MinGW (available from http://www.mingw.org)
This was tested against MinGW-1.1.tar.gz

2) GNU Make (available from http://www.mingw.org)
This was tested with GNU Make v3.79.1, (comes with MinGW-1.1)

2) WinPCAP developer's pack (available from
http://netgroup-serv.polito.it/winpcap/install/bin/WPdpack.zip)
This was tested with Release 2.2 of WinPcap

3) gdbm for win32/mingw (from http://sourceforge.net/projects/mingwrep)
This was tested with gdbm-1.8.0-20010430.zip

4) ntop (available from http://www.ntop.org)
This was tested with http://snapshot.ntop.org/tgz/ntop-01-11-06.tgz

Steps

1) Install all prerequisites

2) Apply the patch distributed with these notes. This patch adds
the appropriate Makefiles and redefines a few preprocessor
conditionals to values more appropriate for MinGW.

2) Edit the ntop/Makefile.mingw and fill in the following values:

INC_GDBM (where the gdbm header files can be found)
INC_WPDPACK (where the winpcap header files can be found)
LIB_GDBM (where libgdbm.a is found)
LIB_WPDPACK (where libpcap.a is found)

If you're using a separate gdchart, gd, libpng, or libz, you'll
also need to change the include and library paths for these as well.

3) Build the sub-components (starting from the ntop-current directory)

3a) Build zlib

cd gdchart0.94c/zlib1.1.3
make -f Makefile.mingw
cd ../..

3b) Build libpng

cd gdchart0.94c/gd-1.8.3/libpng-1.0.8
make -f scripts/makefile.mingw
cd ../../../

3c) Build gd

cd gdchart0.94c/gd-1.8.3
make -f Makefile.mingw
cd ../..

3d) Build gdchart

cd gdchart0.94c
make -f Makefile.mingw

4) Build ntop itself

cd ntop
make -f Makefile.mingw


5) Package ntop and the dependent files

Into the install directory, copy ntop.exe and the html
subdirectory hierarchy.

Ensure that the appropriate DLL's are in your path. For this
build, that includes libgdbm-2.dll and wpcap.dll.

6) Use it

Execute ntop.exe from the install directory. You can get command
line help by running ntop.exe -h

cheers,
--Scott

--
Scott Renfro <scott [at] renfro>


jltseng at oridus

Jan 18, 2002, 12:42 AM

Post #2 of 2 (118 views)
Permalink
RE: ntop win32-mingw patch and notes [In reply to]

This is a email to follow up on Scott Renfro's posting in November.

I follow BUILD-MinGW.txt to compile NTOP 2.0 ( December 27, 2001 )on Win
2000 and Win ME.
There are some mistakes have to be corrected:

1. ntop/Makefile.mingw
i) rm won't work there is no rm.exe in MinGW1.1. You have to add 'rm'
from other utility package OR create empty rm.bat OR delete 8.o manually.

ii) The following command in Makefile.mingw generate a incorrect
version.c
.............
version.c:
-rm $@
echo "char version[] = \"$(VERSION)\";" > $@
echo "char osName[] = \"$(OSNAME)\";" >> $@
echo "char author[] = \"Luca Deri <deri [at] unipi>\";" >> $@
.............
The version.c is
"char version[] = \"1.1\";"
"char osName[] = \"win2k\";"
It should not have outer double quotation.
The correct version.c is
char version[] = "1.1";
char osName[] = "win2k";

iii) protocols.c is missing in CSRC
............
CSRC = ntop.c pbuf.c util.c http.c vendor.c report.c qsort.c \
globals-core.c globals-report.c address.c admin.c \
dataFormat.c emitter.c event.c graph.c hash.c \
initialize.c leaks.c logger.c main.c ntop_win32.c \
reportUtils.c traffic.c plugin.c webInterface.c term.c \
netflow.c sql.c rules.c plugins/icmpPlugin.c \
plugins/lastSeenPlugin.c plugins/nfsPlugin.c \
plugins/rmonPlugin.c plugins/wapPlugin.c regex.c
............

2. ntop run time error
After I made the above changes I can get ntop.exe. ( I compiled on
both Win2000 and WinME platforms) ntop.exe runs well on Win 2000 but it can
not run on Win ME.

D:\ntop>ntop
Wait please: ntop is coming up...
17/Jan/2002 23:35:37 Initializing IP services...
17/Jan/2002 23:35:37 Initializing GDBM...
17/Jan/2002 23:35:37 Database './dnsCache.db' open failed: unknown gdbm
errno
17/Jan/2002 23:35:37 Possible solution: please use '-P <directory>'

dnsCache.db is created but size is zero.

Does version.c statements OK for WinME?
char version[] = "1.1";
char osName[] = "win2k";
Or there is some problem on win32/mingw with WinME?
(I use gdbm-1.8.0-20010430.zip from
http://sourceforge.net/projects/mingwrep)


Thanks for reply,

Jen-Lung

NTop dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.