32f01714632a5bce2194e1750d456d4bbace178b
[obnox/wireshark/wip.git] / README.win32
1 $Id: README.win32,v 1.57 2004/01/07 12:12:09 ulfl Exp $
2
3 Installing Ethereal, Tethereal, and Editcap on Win32
4 ====================================================
5 These are the instructions for installing Ethereal
6 from the installation executable that is provided on
7 the Ethereal website at:
8
9 http://www.ethereal.com/distribution/win32
10
11 and any of its mirrors.
12
13 The installation package allows you to install:
14
15         o Ethereal - the GUI version
16         o Tethereal - the console, line-mode version
17         o Editcap - a console, line-mode utility to convert
18           capture files from one format to another.
19           (The same functions are available in Ethereal)
20         o Text2Pcap - a console, line-mode utility to generate 
21           a capture file from an ASCII hexdump of packets
22         o Mergecap - a console, line-mode utility to merge two 
23           capture files into one
24
25 Additionally, the installation package contains a "plugins"
26 option, which installs some additional dissector plugins
27 for use with Ethereal and Tethereal.
28
29 All binaries in Ethereal package are now built with debugging
30 information embedded. If you are experiencing a crash when running
31 Ethereal or other binaries, Dr. Watson or your debugger
32 can use the information embedded in the binary to provide useful 
33 information to the Ethereal developers that will help them pinpoint 
34 the problem. 
35
36 In the past, two versions of Ethereal binaries were published -- a
37 version that could capture packets and a version which could not.
38 The latter is useful if you're only reading files produced by
39 another product (e.g., a sniffer, firewall, or intrustion detection system)
40 and did not wish to install WinPcap, the library Ethereal uses
41 to capture packets on Win32 platforms.
42
43 As of WinPcap 2.1, all the WinPcap libraries have been released as DLLs. 
44 This means that Ethereal can detect the presence of WinPcap at run time,
45 which means that only one version of the Ethereal binaries needs to be
46 shipped.
47
48 If you don't want to capture packets, just install the Ethereal
49 package. If you do want to capture packets, install Ethereal *and*
50 install the latest non-beta version of WinPcap, available from:
51
52         http://winpcap.polito.it/
53
54 and mirrored at
55
56         http://winpcap.mirror.ethereal.com/
57
58 and
59
60         http://www.mirrors.wiretapped.net/security/packet-capture/winpcap/
61
62 If you already have an earlier version of WinPcap installed, you need to
63 un-install it and install the latest version.  If the older version is
64 WinPcap 2.0 or 2.02, and you have other applications that use the older
65 version , you will have to decide which applications to keep, since
66 WinPcap 2.0/2.02 and later versions cannot be installed on the same
67 system at the same time.
68
69 If Ethereal is not capturing packets and you have WinPcap installed, you
70 can test your WinPcap installation by installing WinDump (tcpdump for
71 Windows) ported by the same folks who make WinPcap.  It's at:
72
73         http://windump.polito.it/
74
75 and mirrored at
76
77         http://windump.mirror.ethereal.com/
78
79 and
80
81         http://www.mirrors.wiretapped.net/security/packet-capture/windump/
82
83 They also make Analyzer, a GUI sniffer for Win32:
84
85         http://analyzer.polito.it/
86
87 The rest of this documentation is only interesting if
88 you want to compile Ethereal yourself.
89
90
91 Running Ethereal, Tethereal, and Editcap on Win32
92 =================================================
93 You need the glib and gtk libraries for running Ethereal. 
94
95 These packages for win32 can be found at:
96
97         http://www.ethereal.com/distribution/win32
98
99 and at the home page for the GTK+ for Win32 project:
100
101         http://www.gimp.org/~tml/gimp/win32
102
103 or
104         http://www.iki.fi/tml/gimp/win32/
105
106 (the mirror nearer to you may be faster).
107
108 Plugins (gryphon.dll and mgcp.dll) can go in:
109         <Ethereal installation directory>\plugins\<version>
110
111 Where <version> is the version number, without brackets.  For example,
112 if you have Ethereal 0.9.8 installed in the default location, plugins
113 will reside in C:\Program Files\Ethereal\plugins\0.9.8
114
115 Yes, the location of plugins needs to be more flexible.
116
117 Make sure the glib and gtk DLL's are in your path - i.e., that your
118 path includes the directory (folder) or directories (folders) in which
119 those DLLs are found - when you run Ethereal.  This includes gtk-*.dll,
120 glib-*.dll, gmodule-*.dll, gdk-*.dll, intl.dll, and iconv-*.dll.  As of
121 the 20000805 GTK+/GLIB distribution, gthread-*.dll is no longer needed.
122
123 The Win32 Binary distribution, available from
124
125         http://www.ethereal.com/distribution/win32
126
127 used different version of the GTK+/GLIB libraries at different points
128 in time:
129
130 Ethereal Version                GTK+/GLIB version
131 ----------------                -----------------
132 0.8.16 and after                20001226
133 0.8.11 - 0.8.15                 20000805
134 0.8.9 - 0.8.10                  20000416
135 0.8.8 and before                19990828
136
137
138 Capturing Packets
139 -----------------
140 In order to capture with Win32, you need to install the NDIS
141 packet capture driver for your particular Win32 OS; drivers for Windows
142 9x, Windows NT 4.0, Windows 2000 and Windows XP can be downloaded from the
143 WinPcap home page:
144
145         http://winpcap.polito.it/
146
147 or the mirror site at
148
149         http://www.wiretapped.net/security/packet-capture/winpcap/default.htm
150
151 Compiling the Ethereal distribution from source
152 ===============================================
153
154 You'll need the development packages for GLIB, GTK+, iconv, gettext,
155 WinPcap, zlib, Net-SNMP, ADNS, and PCRE.  The GLIB, GTK+, and WinPcap
156 packages are available from the respective home pages for each project
157 (the same URLs as listed above). The development packages contain header
158 files and stub libraries to link against.  Precompiled versions of all
159 of these packages, except for WinPcap, are available at
160
161         http://www.ethereal.com/distribution/win32/development/
162
163 The ADNS package is also available at its homepage:
164
165         http://adns.jgaa.com/
166
167 By default, the build process looks for these packages in
168 C:\ethereal-win32-libs.  You can place them in a different directory, but
169 you must update config.nmake accordingly.  The default location for each
170 package is as follows:
171
172     Package                               Default Location
173     -------                               ----------------
174     adns-1.0-win32-01.zip                 C:\ethereal-win32-libs
175     glib-2.2.3.zip                        C:\ethereal-win32-libs\glib
176     glib-dev-2.2.3.zip                    C:\ethereal-win32-libs\glib
177     gtk+-1.3.0-20030717.zip               C:\ethereal-win32-libs\gtk+
178     gtk+-dev-1.3.0-20030115.zip           C:\ethereal-win32-libs\gtk+
179     libiconv-1.9.1.bin.woe32.zip          C:\ethereal-win32-libs\libiconv-1.9.1.bin.woe32
180     gettext-runtime-0.12.1.bin.woe32.zip  C:\ethereal-win32-libs\gettext-runtime-0.12.1.bin.woe32
181     net-snmp-5.1.zip                      C:\ethereal-win32-libs
182     pcre-4.4.zip                          C:\ethereal-win32-libs
183     wpdpack_3_0.zip                       C:\ethereal-win32-libs
184     zlib121-dll.zip                       C:\ethereal-win32-libs\zlib121-dll
185
186 (to use the default locations, the directories in question should be
187 created, and each zip file should be unpacked into the corresponding
188 directory).  If you only want to change the C:\ethereal-win32-libs
189 part, you just change the setting of ETHEREAL_LIBS in config.nmake; if
190 you want to change subdirectories, you'll have to change the individual
191 item for a package.  (Note that some zip files create the subdirectory -
192 those zip files just have C:\ethereal-win32-libs in the list above - so
193 if you don't want the package to be in that subdirectory, you'd have to
194 rename the directory.)
195
196 The gettext runtime package provides intl.dll, which is needed by
197 GLib 2.2.3.
198
199 Instructions for MS Visual C++
200 ----------------------------
201 Modify the config.nmake file in the top directory of the Ethereal source
202 tree to work for your local configuration; if you don't have Python,
203 comment out the line that defines PYTHON, otherwise set it to refer to
204 the pathname of your Python interpreter executable.  You should not have
205 to modify any other Makefile.
206
207 Many of the file and directory names used in the build process go past
208 the old 8.3 naming limitations.  As a result, at least on Windows NT 4.0,
209 Windows 2000, Windows XP, and Windows .NET Server, you should use the
210 newer "cmd.exe" command interpreter instead of the old "command.com",
211 as the "command.com" on Windows 2000, at least, can't handle non-8.3
212 directory names.  (It may be that the "command.com" in Windows 95, Windows
213 98, and Windows Me, as it's the only command interpreter in those systems,
214 can handle those directories.  If not, it may not be possible to build
215 Ethereal from the command line on those versions of Windows.)
216
217 Be sure that your command-line environment is set up to compile
218 and link with MSVC++. When installing MSVC++, you can have your
219 system's environment set up to always allow compiling from the
220 command line, or you can invoke the vcvars32.bat script, which can
221 usually be found in the "VC98\Bin" subdirectory of the directory in
222 which Visual Studio was installed.
223
224 The first time you build Ethereal, run the script "cleanbld.bat" in the
225 top-level Ethereal source directory to make sure that the "config.h"
226 files will be reconstructed from the "config.h.win32" files.  (If, for
227 example, you have "config.h" files left over from a Unix build, a
228 Windows build will fail.)
229
230 In the ethereal directory, type "nmake -f makefile.nmake". It will
231 recurse into the subdirectories as appropriate.
232
233 Some generated source is created by traditionally "Unix-ish" tools.
234
235 If you are building from an official distribution, these files are
236 already generated, although they were generated on a Unix-compatible
237 system.  In most cases, the generated files can be used when building on
238 Windows, but the files listed below as being generated by Flex can be
239 used when building on Windows only when generated by a Windows version
240 of Flex, so you will need a Windows version of Flex to do a Windows
241 build.  Those generated files are removed by the "cleanbld.bat" script,
242 to make sure that versions left over from a Unix build aren't used.
243
244 If you are building from a modified version of an official distribution,
245 and you modified any of the source files listed below, you will need the
246 tool(s) that generate output from those source files.
247
248 If building from a CVS image, you'll need all the tools to generate C
249 source.
250
251 The "special" files and their requisite tools are:
252
253 Source                          Output                  Tool
254 ------                          ------                  ----
255 config.h.win32                  config.h                sed
256 epan/config.h.win32             epan/config.h           sed
257 image/ethereal.rc.in            image/ethereal.rc       sed
258 image/tethereal.rc.in           image/tethereal.rc      sed
259 image/editcap.rc.in             image/editcap.rc        sed
260 image/mergecap.rc.in            image/mergecap.rc       sed
261 image/text2pcap.rc.in           image/text2pcap.rc      sed
262 packaging/nsis/ethereal.nsi.in  packaging/ethereal.nsi  sed
263 wiretap/config.h.win32          wiretap/config.h        sed
264 epan/dfilter/dfilter-scanner.l  epan/dfilter/*.c        Flex
265 text2pcap-scanner.l             *.c                     Flex
266 wiretap/ascend-scanner.l        *.c                     Flex
267 wiretap/ascend-grammar.y        *.c,*.h                 Bison/Yacc
268 ncp2222.py                      packet-ncp2222.c        Python
269
270 make-reg-dotc, packet*.c        register.c              Bash + grep + sed
271 or
272 make-reg-dotc.py, packet*.c     register.c              Python
273
274 make-tapreg-dotc, tap-*.c       tethereal-tap-register.c
275                                                         Bash + grep + sed
276 make-tapreg-dotc, tap files     gtk/ethereal-tap-register.c
277     in the gtk subdirectory                             Bash + grep + sed
278
279 The Makefile.nmake supplied with the Ethereal distribution will, if
280 PYTHON is defined in config.nmake, attempt to make register.c with
281 Python, since it is much much much faster than the shell version.  The
282 reason it is faster is because the shell version launches multiple
283 processes (grep, sed) for each source file, multiple times.  The Python
284 script is one process.  This matters a lot on Win32.
285
286 If you have a Unix system handy, you can first build on Unix to create
287 most of the source files that these tools make, then run the build on
288 Windows.  That will avoid the need for these tools on your Windows
289 computer.  This won't work for the files in the "image" directory,
290 however, as those aren't built on Unix - they're only for Windows
291 builds.  It also won't work for the "config.h" files; whilst those are
292 built for Unix, they're specific to the platform on which you're
293 building, and the "config.h" files constructed for a Unix build will not
294 work with a Windows build.  In addition, it won't work for the files
295 generated by Flex, as, for a Windows build, those have to be generated
296 by a Windows version of Flex.
297
298 Most of those tools are available for Win32 systems as part of the
299 Cygwin package:
300
301         http://sources.redhat.com/cygwin/
302
303 After installing them, you will probably have to modify the config.nmake
304 file to specify where the Cygwin binaries are installed.
305
306 Python for Win32 is available from
307
308         http://www.python.org/
309
310
311 Instructions for Cygwin
312 -----------------------
313
314 It is possible to build Ethereal under Cygwin using their version
315 of XFree86. References:
316  - http://www.ethereal.com/lists/ethereal-dev/200205/msg00107.html
317  - http://www.ethereal.com/lists/ethereal-dev/200302/msg00026.html
318  
319 To get it running, execute the following steps:
320
321 1. Install the required cygwin packages (compiler, scripting, X, zlib)
322    with the CygWin setup.exe tool (http://www.cygwin.com/).
323    You need the base Xfree86 support plus the X headers package in order
324    to be able to compile the gtk+ package.
325
326 2. Download glib-1.2.10 and gtk+-1.2.10 from a mirror of www.gnome.org.
327
328 3. Retrieve the patches for glib-1.2.10 and gtk+-1.2.10 from
329    http://homepage.ntlworld.com/steven.obrien2/
330
331  + glib-1.2.10
332    http://homepage.ntlworld.com/steven.obrien2/ (URL cont'd on next line)
333           /libs/patches/glib-1.2.10-cygwin.patch
334
335  + gtk+-1.2.10
336    http://homepage.ntlworld.com/steven.obrien2/ (URL cont'd on next line)
337           /libs/patches/gtk+-1.2.10-cygwin.patch
338
339 4. Compile and install both packages after patching (see instructions
340    at the bottom of http://homepage.ntlworld.com/steven.obrien2/):
341
342    Set the path:
343
344      $ PATH=/opt/gnome/bin:/usr/X11R6/bin:$PATH
345
346    For glib-1.2.10:
347    
348      $ cd glib-1.2.10
349      $ patch -p1 < /path/to/glib-1.2.10-cygwin.patch
350      $ CFLAGS=-O2 ./configure --prefix=/opt/gnome --with-threads=posix
351      $ make
352      $ make check
353      $ make install
354
355    For gtk+-1.2.10:
356
357      $ cd gtk+-1.2.10
358      $ patch -p1 < /path/to/gtk+-1.2.10-cygwin.patch
359      $ CFLAGS=-O2 ./configure --prefix=/opt/gnome
360      $ make
361      $ make check
362      $ make install
363
364 5. Patch Makefile.am in <ethereal-src>/gtk/Makefile.am by
365    removing "gtkclist.c" from the dependencies.
366
367    This patch is required since the private GTK+ clist widget
368    (was required for earlier versions of GTK+ but prevents Ethereal
369    from running with cygwin).
370
371 6. Configure and make Ethereal:
372
373    Set the path (if this has not yet been done earlier)
374
375      $ PATH=/opt/gnome/bin:$PATH
376
377      $ ./autogen.sh --without-pcap --without-plugins
378      $ ./configure --without-pcap --without-plugins
379      $ make
380
381    This make will eventually stop, but it is required as e.g., the
382    GTK binaries are built then.
383
384      $ make ethereal.exe
385
386 7. Start X
387
388      $ sh /usr/X11R6/bin/startxwin.sh
389
390    For non-US keyboard layouts, use (replace 'be' with your layout):
391
392      $ setxkbmap.exe -layout be
393
394 8. Run ethereal (add /opt/gnome/bin to $PATH if this is not yet done)
395
396      $ <ethereal-src>/ethereal
397
398    And voila! Behold the mighty sniffer in all its glory!
399
400 Something is wrong with the makefile that gets generated, so it doesn't work
401 just running make.
402 I am not curious enough to look at why 'make' doesnt work; 'make ethereal.exe'
403 works well enough for me.
404
405 Note: Compiling Ethereal under cygwin takes a lot of time, because the
406 generation of 'register.c' takes ages. If you only edit one dissector and
407 you know what you're doing, it is acceptable to uncomment the generation
408 of the file 'register.c' in Makefile. Look for the 'register.c' target:
409
410     register.c: $(DISSECTOR_SRC) $(srcdir)/make-reg-dotc
411         @echo Making register.c
412         # @$(srcdir)/make-reg-dotc register.c $(srcdir) $(DISSECTOR_SRC)
413         @echo Skipping generation of register.c
414
415 Of course, you need to generate the 'register.c' file at least once.