add winpcap 4.0.2 from url http://www.winpcap.org/
[natblaster.git] / winpcap / dox / wpcap_samp.htm
blobcd6100023adf65cee6a16f8298f4284f06b9d939
1 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
5 <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
6 <meta name="ProgId" content="FrontPage.Editor.Document">
7 <title></title>
8 </head>
10 <body>
11 <h2>Creating an application that uses <i>wpcap.dll</i></h2>
12 <p>To create an application that uses <i>wpcap.dll</i> with Microsoft Visual C++,
13 follow these
14 steps:</p>
15 <ul>
16 <li>Include the file <i>pcap.h</i> at the beginning of every source file that
17 uses the functions exported by library.</li>
18 <li>If your program uses Win32 specific functions of WinPcap, remember to include <i>WPCAP</i>
19 among the preprocessor definitions.</li>
20 <li>If your program uses the remote capture capabilities of WinPcap, add <i>
21 HAVE_REMOTE</i> among the preprocessor definitions. Do <i>not</i> include
22 remote-ext.h directly in your source files.<li>Set the options of the linker to include the <i>wpcap.lib</i> library
23 file. <i>wpcap.lib</i> can
24 be found in the WinPcap developer's pack.
25 <li>Set the options of the linker to include the winsock library file<i>
26 ws2_32.lib</i>. This file is distributed with the C compiler
27 and contains the socket functions for Windows. It is needed by some
28 functions used by the samples in the tutorial.</li>
29 </ul>
30 <p><b>Remember that</b>:</p>
31 <ul>
32 <li>To add a preprocessor definition, you must select <em>Settings</em> from the <em>Project</em> menu, then select <em>C/C++</em>
33 from the tab control, and under the category <i>General</i>, you must add
34 the definition under the <i>Preprocessor Definitions</i> text box.
35 <li>To add a new library to the project with Microsoft Visual C++ 6.0, you must
36 select <em>Settings</em> from the <em>Project</em> menu, then select <em>Link</em>
37 from the tab control, and then add the name of the new library in the <em>Object/library
38 modules</em> edit box.
39 <li>To add a new path where Microsoft Visual C++ 6.0 will look for the libraries,
40 you must select <em>Options</em> from the <em>Tools</em> menu, then <em>
41 Directories</em>
42 from the tab control, <em>Library files</em> from the <em>Show directories
43 for</em> combo box, and the add the path in the <em>Directories</em> box.
44 <li>To add a new path where Microsoft Visual C++ 6.0 will look for include files, you must select <em>Options</em> from the <em>Tools</em> menu, then
45 <em>Directories</em>
46 from the tab control, <em>Include files</em> from the <em>Show directories
47 for</em> combo box, and the add the path in the <em>Directories</em> box.</li>
48 </ul>
49 <h2>Sample programs</h2>
50 <p>A couple of sample programs are provided to show the usage of the WinPcap API. The
51 source of the examples, along with all the files needed to compile and run them, can be found in the <a href="http://www.winpcap.org/install/bin">Developer's
52 Pack</a>.&nbsp; For didactic purpose we provide here a browsable version of the
53 code: it is possible to click on the variables and functions to jump the
54 documentation of each of them. For a more complete set of samples, try <a href="group__wpcap__tut.htm">WinPcap
55 Tutorial Section</a>.</p>
57 </body>
59 </html>