summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/winpcap/docs/html/group__compilation.html
blob: 8a7e1400490fee9a666064b006faea8f06e3f80a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>WinPcap: How to compile WinPcap</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>How to compile WinPcap<br/>
<small>
[<a class="el" href="group__internals.html">WinPcap internals</a>]</small>
</h1><table border="0" cellpadding="0" cellspacing="0">
</table>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
</head>

<body>
<p>This section explains how to compile WinPcap, both the kernel level and
the user-level portion, on the various Win32 platforms. The source code can be
found on the <a href="http://www.winpcap.org/">WinPcap website</a>.</p>
<h2>Compiling the driver</h2>
<p>Two main NPF source trees are available for compilation:&nbsp; Windows NTx and Windows 9x. Note that, since the NPF 
Driver is platform-dependent, it is STRONGLY suggested to compile it for the OS where it will be used, in order to
link the correct DDK libraries. For example, if you compile the
driver with the Windows NT 4 DDK, it will not work properly on Windows 2000 and 
vice versa.</p>
<h3>Compiling the driver for Windows NT4</h3>
<p>Software requirements:</p>
<ul>
	<li>Microsoft Driver Developer Kit (DDK) for Windows NT4</li>
	<li>A recent version of the Microsoft Platform Software Development Kit 
	(SDK) that is compatible with Visual Studio 6 (the latest compatible one is 
	Platform SDK February 2003). This version of the PSDK is available on the 
	Microsoft web site at
	<a href="http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm">
	http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm</a>. 
	It can be ordered online at
	<a href="http://www.qmedia.ca/launch/psdk.htm">
	http://www.qmedia.ca/launch/psdk.htm</a>, and it's also available to 
	Microsoft MSDN subscribers on the Subscribers Downloads web site.<li>Microsoft Visual C++ 6.0 
	with Service Pack 5 or 6 (both the service packs are available online on the 
	Microsoft web site).</ul>
<p>If your system satisfies these requirements, follow these steps:</p>
<ol>
  <li>From the Windows NT Start menu, select the folder <em>Programs</em> and
    then <i>Development Kits</i>, then <em>Windows NT4 DDK.</em> From here select the voice 
	<em>Checked Build
    Environment</em> if you want to build a debug version, or <em>Free Build
    Environment</em> if you want to build a release version.
  <li>A command prompt will be opened. Move to the directory PacketNTx inside the
    WinPcap source folder and type the command<br><br><i>CompileDriver<br></i>
	<br>This script will generate the driver (npf.sys). The binary will be put in 
	one of these folders<ul>
	<li><i>Free Build Environment: </i>winpcap\PacketNTx\driver\bin\NT4\i386\free</li>
	<li><i>Checked Build Environment: </i>winpcap\PacketNTx\driver\bin\NT4\i386\checked</li>
	</ul>
</ol>
<p><b>Warning</b>: sometimes, during the compilation of the driver, a lot of
'last line incomplete' errors are generated. Ignore these errors and let the
compilation process continue, they are due to bugs in some DDK versions.</p>
<h3>Compiling the driver for Windows 2000/XP/2003/Vista/2008/Win7/2008R2 (x86 and x64)</h3>
<p>Software requirements:</p>
<ul>
	<li>Microsoft Windows Driver Kit (WDK) 6001.18002. As of release 4.1, 
	WinPcap is compiled with WDK 6001.18002.</li>
</ul>
<p>NOTE: it should be possible to use older DDKs to compile WinPcap, but you 
might need to 
manually modify the compilation scripts in order to disable PREfast (PREfast is 
a static code analysis tool shipped with recent versions of the DDK/WDK).</p>
<p>If your system satisfies these requirements, follow these steps:</p>
<ol>
  <li>From the Windows Start menu, select the folder <em>Programs</em> and
    then <i>Windows Driver K</i>, then <em>WDK 6001.18002</em>, then <em>Build Environments</em>.<ul>
	<li>x86 driver: Choose <em>Windows 2000</em> and then <em>Windows 2000 x86 Free Build Environment </em>if you want to build a release version or <em>Windows 2000 
	x86 Checked Build Environment </em>if you want to build a debug version.</li>
	<li>x64 driver: Choose <em>Windows Server 2003</em> and then <em>Windows 
	Server 2003 x64 Free&nbsp;Build Environment </em>if you want to build a release version or
	<em>Windows Server 2003 
	x64 Checked Build Environment </em>if you want to build a debug version.</li>
	</ul>
	<li>A command prompt will be opened. Move to the directory PacketNTx inside the
    WinPcap source folder and type the command<br><br><i>CompileDriver<br></i>
	<br>This script will generate the driver (npf.sys). The binary will be put in 
	one of these folders<ul>
		<li><i>x86 driver (both Free and Checked Build): </i>winpcap\PacketNTx\driver\bin\i386</li>
		<li><i>x64 driver (both Free and Checked Build): </i>winpcap\PacketNTx\driver\bin\amd64</li>
	</ul>
  </ol>
<h3>Compiling the driver on Windows 9x</h3>
<p><font color="#FF0000">NOTE: this Windows platform is no longer supported by 
WinPcap. However, the sources for these operating systems are still available in 
the sources package.</font></p>
<p>To compile the driver for Windows 9x you will need:</p>
<ul>
  <li>Driver Developer Kit (DDK) for Windows 95/98/ME
  <li>A recent version of the Microsoft Platform Software Development Kit (SDK) 
	that is compatible with Visual Studio 6 (the latest compatible one is 
	Platform SDK February 2003). This version of the PSDK is available on the 
	Microsoft web site at
	<a href="http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm">
	http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm</a>. 
	It can be ordered online at
	<a href="http://www.qmedia.ca/launch/psdk.htm">
	http://www.qmedia.ca/launch/psdk.htm</a>, and it's also available to 
	Microsoft MSDN subscribers on the Subscribers Downloads web site.<li>Microsoft Visual C++ 6.0 
	with Service Pack 5 or 6 (both the service packs are available online on the 
	Microsoft web site).</ul>
<p>The steps to follow are:</p>
<ol>
  <li>Open a DOS shell
  <li>Go to the VisualC++ BIN directory (for example C:\DEVSTUDIO\VC\BIN) and
    execute the command<br>
    <br>
    <em>Vcvars32<br>
    </em>
  <li>Go to the SDK directory (for example C:\MSSDK) and execute the command<br>
    <br>
    <em>Setenv sdk_path</em><br>
    <br>
    where <em>sdk_path</em> is the directory of SDK (for example Setenv C:\MSSDK)
  <li>Go to the DDK directory (for example C:\DDK) and execute the command<br>
    <br>
    <em>Ddkenv 32 net<br>
    </em>
  <li>Move to the directory whit the driver's source code and type the command<br>
    <br>
    <em>nmake rtl<br>
    <br>
    </em>to obtain a release version, or<br>
    <br>
    <em>nmake<br>
    <br>
    </em>to obtain a debug version.<br>The release version of <i>packet.vxd</i> will be placed in the 
	<em>retail</em>
    directory, the debug version in the <em>debug</em> directory.</li>
</ol>
<p><strong>Warning</strong>: On some systems the NMAKE utility is not able to
launch ADRC2VXD, this means that the driver binary is generated correctly, but
without the copyright information. We don't know the cause of this problem.</p>
<h2>Compiling packet.dll</h2>
<p>The source tree for this DLL is located in PacketNTx\dll\.</p>
<p><font color="#FF0000">NOTE: the 9x family of Windows operating systems is no longer supported 
by WinPcap. However, the sources for these operating systems are still available 
in the sources package.</font></p>
<p>Software requirements:</p>
<ul>
	<li>Microsoft Visual Studio 2005 SP1. It's theoretically possible to compile 
	the x86 version with Visual Studio 6, but the project files are no longer 
	maintained.<li>The AirPcap developer's pack from
	<a href="http://www.cacetech.com/products/airpcap.htm">
	http://www.cacetech.com/products/airpcap.htm</a>. The AirPcap developer's 
	pack needs to be unzipped in a folder in the same folder where the WinPcap 
	sources have been unzipped.</ul>
<p>To compile the PACKET.DLL, load the project <i>packet.sln</i> contained in the directory PacketNTx\dll\project
in Visual Studio 2005. There are several project 
configurations, each of them available for the x86 (Win32) and x64 platforms:</p>
<ul>
  <li><i>Release</i>: standard release configuration</li>
  <li><i>Debug</i>: standard debug configuration</li>
  <li><i>Release NT4</i>: release configuration able to run on 
  NT4. It does not include Wan and IP helper API support.</li>
	<li><i>Debug NT4</i>: debug configuration able to run on 
  NT4. It does not include Wan and IP helper API support.</li>
  <li><i>Release No NetMon</i>: release configuration able to run on 
  Vista. It 
  does not include Wan support (with the NetMon API).</li>
	<li><i>Debug No NetMon</i>: debug configuration able to run on 
	Vista. It 
  does not include Wan support (with the NetMon API).</li>
  <li><i>Release LOG_TO_FILE</i>: standard release configuration with tracing to 
	file enabled.</li>
  <li><i>Release NT4 LOG_TO_FILE</i>: release configuration able to run on 
  NT4 with tracing to file enabled. It does not include Wan and IP helper API support.</li>
  <li><i>Release No NetMon LOG_TO_FILE</i>: release configuration able to run on 
  Vista with tracing to file enabled. It 
  does not include Wan support (with the NetMon API).</li>
</ul>
<p>Choose the desired configuration and build the project to obtain the binary 
files.</p>
<h2>Compiling wpcap.dll</h2>
<p>wpcap.dll can be compiled for any Win32 platform and the generated dll is system independent.</p>
<p>System Requirements:</p>
<ul>
  <li>Microsoft Visual Studio 2005 SP1. It's theoretically possible to compile 
	the x86 version with Visual Studio 6, but the project files are no longer 
	maintained.<li>The AirPcap developer's pack from
	<a href="http://www.cacetech.com/products/airpcap.htm">
	http://www.cacetech.com/products/airpcap.htm</a>. The AirPcap developer's 
	pack needs to be unzipped in a folder in the same folder where the WinPcap 
	sources have been unzipped.There are eight build project configurations:</ul>
<p>To compile the wpcap.dll, load the project <i>wpcap.sln</i> contained in the directory 
wpcap\PRJ
in Visual Studio 2005. There are several project 
configurations, each of them available for the x86 (Win32) and x64 platforms:</p>
<ul>
	<li><i>Release</i>: standard release configuration</li>
	<li><i>Debug</i>: standard debug configuration</li>
	<li><i>Release No AirPcap</i>: release configuration without support for 
	AirPcap adapters.</li>
	<li><i>Debug No AirPcap</i>: debug configuration without support for AirPcap 
	adapters.</li>
</ul>
<p>Choose the desired configuration and build the project to obtain the binary 
files.</p>
<p><i>Note</i>: wpcap.dll contains the source code of libpcap from
<a href="http://www.tcpdump.org">www.tcpdump.org</a>, with some modifications 
for remote capture. You will be able to include and build a different libpcap 
version simply copying it in the directory <i>winpcap\wpcap\prj</i> of the 
WinPcap source code distribution, but you must use the &quot;Debug&quot; or &quot;Release&quot; 
build configurations.<br>
&nbsp;</p>

</body>

</html>
 </div>

<hr>
<p align="right"><img border="0" src="winpcap_small.gif" align="absbottom" width="91" height="27">
documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009
CACE Technologies. All rights reserved.</p>