mame/3rdparty/winpcap/docs/html/wpcap__remote_8htm_source.html
2015-01-10 12:21:12 +01:00

383 lines
30 KiB
HTML

<!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: wpcap_remote.htm Source File</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 class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<h1>wpcap_remote.htm</h1><a href="wpcap__remote_8htm.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;html&gt;
<a name="l00002"></a>00002
<a name="l00003"></a>00003 &lt;head&gt;
<a name="l00004"></a>00004 &lt;meta http-equiv=<span class="stringliteral">&quot;Content-Type&quot;</span> content=<span class="stringliteral">&quot;text/html; charset=windows-1252&quot;</span>&gt;
<a name="l00005"></a>00005 &lt;meta name=<span class="stringliteral">&quot;GENERATOR&quot;</span> content=<span class="stringliteral">&quot;Microsoft FrontPage 4.0&quot;</span>&gt;
<a name="l00006"></a>00006 &lt;meta name=<span class="stringliteral">&quot;ProgId&quot;</span> content=<span class="stringliteral">&quot;FrontPage.Editor.Document&quot;</span>&gt;
<a name="l00007"></a>00007 &lt;title&gt;Using WinPcap Remote Capture&lt;/title&gt;
<a name="l00008"></a>00008 &lt;/head&gt;
<a name="l00009"></a>00009
<a name="l00010"></a>00010 &lt;body&gt;
<a name="l00011"></a>00011
<a name="l00012"></a>00012 &lt;hr&gt;
<a name="l00013"></a>00013 &lt;ul&gt;
<a name="l00014"></a>00014 &lt;li&gt;&lt;a href=<span class="stringliteral">&quot;#RunningModes&quot;</span>&gt;Remote Capture Running Modes&lt;/a&gt;&lt;/li&gt;
<a name="l00015"></a>00015 &lt;li&gt;&lt;a href=<span class="stringliteral">&quot;#Config&quot;</span>&gt;Configuring the Remote <a class="code" href="wpcap__remote_8htm.html#a258f021c7879aa3b45bdf4d6e922d4f1">Daemon</a> (rpcapd)&lt;/a&gt;&lt;/li&gt;
<a name="l00016"></a>00016 &lt;li&gt;&lt;a href=<span class="stringliteral">&quot;#StartCap&quot;</span>&gt;Starting a capture on a remote machine&lt;/a&gt;&lt;/li&gt;
<a name="l00017"></a>00017 &lt;li&gt;&lt;a href=<span class="stringliteral">&quot;#UNIX&quot;</span>&gt;Installing the Remote Capture <a class="code" href="wpcap__remote_8htm.html#a258f021c7879aa3b45bdf4d6e922d4f1">Daemon</a> in UNIX&lt;/a&gt;&lt;/li&gt;
<a name="l00018"></a>00018 &lt;/ul&gt;
<a name="l00019"></a>00019 &lt;hr&gt;
<a name="l00020"></a>00020 &lt;p&gt;WinPcap comes with Remote Capture capabilities. This is an highly
<a name="l00021"></a>00021 experimental feature that allows to interact to a remote machine and capture
<a name="l00022"></a>00022 packets that are being transmitted on the remote network.&lt;/p&gt;
<a name="l00023"></a>00023 &lt;p&gt;This requires a &lt;b&gt;remote daemon &lt;/b&gt;(called &lt;code&gt;rpcapd&lt;/code&gt;) which
<a name="l00024"></a>00024 performs the capture and sends data back and a &lt;b&gt;local client &lt;/b&gt;that sends
<a name="l00025"></a>00025 the appropriate commands and receives the captured data.&lt;/p&gt;
<a name="l00026"></a>00026 &lt;p&gt;WinPcap extends the standard WinPcap code in such a way that all
<a name="l00027"></a>00027 WinPcap-based tools can expoit remote capture capabilities. For instance, the
<a name="l00028"></a>00028 capabillity to interact with a remote daemon are added to the client software
<a name="l00029"></a>00029 without any <span class="keyword">explicit</span> modification to it. Vice versa, the remote daemon must be
<a name="l00030"></a>00030 explicitely installed (and configured) on the remote machine.&lt;/p&gt;
<a name="l00031"></a>00031 &lt;h2&gt;&lt;a name=<span class="stringliteral">&quot;RunningModes&quot;</span>&gt;&lt;/a&gt;Remote Capture Running Modes&lt;/h2&gt;
<a name="l00032"></a>00032 &lt;p&gt;The Remote Capture Protocol (RPCAP) can work in two modes:&lt;/p&gt;
<a name="l00033"></a>00033 &lt;ul&gt;
<a name="l00034"></a>00034 &lt;li&gt;&lt;b&gt;Passive Mode&lt;/b&gt; (default): the client (e.g. a network sniffer)
<a name="l00035"></a>00035 connects to the remote daemon, it sends them the appropriate commands, and
<a name="l00036"></a>00036 it starts the capture.&lt;/li&gt;
<a name="l00037"></a>00037 &lt;li&gt;&lt;b&gt;Active Mode&lt;/b&gt;: the remote daemon try to establish a <a class="code" href="wpcap__remote_8htm.html#a9626e8afe69dfeee0e9d7a2477dedf52">connection</a> toward
<a name="l00038"></a><a class="code" href="wpcap__remote_8htm.html#a751ff7ed91d2e43008930137c9fa6925">00038</a> the client (e.g. the network sniffer); <a class="code" href="wpcap__remote_8htm.html#a751ff7ed91d2e43008930137c9fa6925">then</a>, the client sends the
<a name="l00039"></a>00039 appropriate commands to the daemon and it starts the capture. This name is
<a name="l00040"></a>00040 due to the fact thet the daemon becomes &lt;i&gt;active&lt;/i&gt; instead of &lt;i&gt;waiting&lt;/i&gt;
<a name="l00041"></a>00041 for new connections.&lt;/li&gt;
<a name="l00042"></a>00042 &lt;/ul&gt;
<a name="l00043"></a>00043 &lt;p&gt;The Active Mode is useful in <a class="code" href="wpcap__remote_8htm.html#a0b27a0048ba88eaf6d523bcc6c6ef00e">case</a> the remote daemon is behind a firewall and
<a name="l00044"></a>00044 it cannot receive connections from the external world. In this <a class="code" href="wpcap__remote_8htm.html#a0b27a0048ba88eaf6d523bcc6c6ef00e">case</a>, the daemon
<a name="l00045"></a>00045 can be configured to establish the <a class="code" href="wpcap__remote_8htm.html#a9626e8afe69dfeee0e9d7a2477dedf52">connection</a> to a given <a class="code" href="wpcap__remote_8htm.html#a3c46d79c790748a5942fb43baa6b3073">host</a>, which will have
<a name="l00046"></a>00046 been configured in order to &lt;i&gt;wait&lt;/i&gt; for that <a class="code" href="wpcap__remote_8htm.html#a9626e8afe69dfeee0e9d7a2477dedf52">connection</a>. After establishing
<a name="l00047"></a>00047 the <a class="code" href="wpcap__remote_8htm.html#a9626e8afe69dfeee0e9d7a2477dedf52">connection</a>, the protocol continues its job in almost the same way in both
<a name="l00048"></a>00048 Active and Passive Mode.&lt;/p&gt;
<a name="l00049"></a>00049 &lt;p&gt;Analyzer (&lt;a href=&quot;http:<span class="comment">//analyzer.polito.it/30alpha/&quot;&gt;http://analyzer.polito.it/30alpha/&lt;/a&gt;)</span>
<a name="l00050"></a>00050 has a set of commands (in the &lt;b&gt;Capture&lt;/b&gt; menu) that allows you to accept a
<a name="l00051"></a>00051 remote connection and <a class="code" href="wpcap__remote_8htm.html#a751ff7ed91d2e43008930137c9fa6925">then</a> start the capture on the remote device. Currently,
<a name="l00052"></a>00052 Analyzer is the only tool that is able to work in active mode, since it requires
<a name="l00053"></a>00053 some modifications to the application code.&lt;/p&gt;
<a name="l00054"></a>00054 &lt;h2&gt;&lt;a name=&quot;Config&quot;&gt;&lt;/a&gt;Configuring the Remote <a class="code" href="wpcap__remote_8htm.html#a258f021c7879aa3b45bdf4d6e922d4f1">Daemon</a> (rpcapd)&lt;/h2&gt;
<a name="l00055"></a>00055 &lt;p&gt;The Remote <a class="code" href="wpcap__remote_8htm.html#a258f021c7879aa3b45bdf4d6e922d4f1">Daemon</a> is a standard Win32 executable running either in console
<a name="l00056"></a>00056 mode or as a service. The executable can be found in the &lt;code&gt;WinPcap&lt;/code&gt;
<a name="l00057"></a>00057 folder and it has the following syntax:&lt;/p&gt;
<a name="l00058"></a>00058 &lt;pre&gt; rpcapd [-b &amp;lt;address&amp;gt;] [-p &amp;lt;port&amp;gt;] [-6] [-l &amp;lt;host_list&amp;gt;] [-a &amp;lt;host,port&amp;gt;]
<a name="l00059"></a>00059 [-n] [-v] [-d] [-s &amp;lt;file&amp;gt;] [-f &amp;lt;file&amp;gt;]&lt;/pre&gt;
<a name="l00060"></a>00060 &lt;p&gt;The daemon can be compiled and it is actually working on Linux as well.&lt;/p&gt;
<a name="l00061"></a>00061 &lt;p&gt;Here there is a brief description of the allowed commands:&lt;/p&gt;
<a name="l00062"></a>00062 &lt;div align=&quot;left&quot;&gt;
<a name="l00063"></a>00063 &lt;table border=&quot;1&quot;&gt;
<a name="l00064"></a>00064 &lt;tr&gt;
<a name="l00065"></a>00065 &lt;th&gt;Switch&lt;/th&gt;
<a name="l00066"></a>00066 &lt;th&gt;Description&lt;/th&gt;
<a name="l00067"></a>00067 &lt;/tr&gt;
<a name="l00068"></a>00068 &lt;tr&gt;
<a name="l00069"></a>00069 &lt;td&gt;
<a name="l00070"></a>00070 &lt;pre&gt;-b &amp;lt;address&amp;gt;&lt;/pre&gt;
<a name="l00071"></a>00071 &lt;/td&gt;
<a name="l00072"></a>00072 &lt;td&gt;It sets the address the daemon has to bind to (either numeric or
<a name="l00073"></a>00073 literal). Default: it binds to all local IPv4 and IPv6 addresses.&lt;/td&gt;
<a name="l00074"></a>00074 &lt;/tr&gt;
<a name="l00075"></a>00075 &lt;tr&gt;
<a name="l00076"></a>00076 &lt;td&gt;
<a name="l00077"></a>00077 &lt;pre&gt;-p &amp;lt;port&amp;gt;&lt;/pre&gt;
<a name="l00078"></a>00078 &lt;/td&gt;
<a name="l00079"></a>00079 &lt;td&gt;It sets the port the daemon has to bind to. Default: it binds to port
<a name="l00080"></a>00080 2002.&lt;/td&gt;
<a name="l00081"></a>00081 &lt;/tr&gt;
<a name="l00082"></a>00082 &lt;tr&gt;
<a name="l00083"></a>00083 &lt;td&gt;
<a name="l00084"></a>00084 &lt;pre&gt;-4&lt;/pre&gt;
<a name="l00085"></a>00085 &lt;/td&gt;
<a name="l00086"></a>00086 &lt;td&gt;It binds only to IPv4 addresses. Default: both IPv4 and IPv6 waiting
<a name="l00087"></a>00087 sockets are used.&lt;/td&gt;
<a name="l00088"></a>00088 &lt;/tr&gt;
<a name="l00089"></a>00089 &lt;tr&gt;
<a name="l00090"></a>00090 &lt;td&gt;
<a name="l00091"></a>00091 &lt;pre&gt;-l &amp;lt;host_list_file&amp;gt;&lt;/pre&gt;
<a name="l00092"></a>00092 &lt;/td&gt;
<a name="l00093"></a>00093 &lt;td&gt;It specifies a file that keeps the list of the hosts which are allowed
<a name="l00094"></a>00094 to connect to this daemon (if more than one, the file keeps them one per
<a name="l00095"></a>00095 line). We suggest to use literal names (instead of numeric ones) in
<a name="l00096"></a>00096 order to avoid problems with different address families (IPv4 and IPv6).&lt;/td&gt;
<a name="l00097"></a>00097 &lt;/tr&gt;
<a name="l00098"></a>00098 &lt;tr&gt;
<a name="l00099"></a>00099 &lt;td&gt;
<a name="l00100"></a>00100 &lt;pre&gt;-n&lt;/pre&gt;
<a name="l00101"></a>00101 &lt;/td&gt;
<a name="l00102"></a>00102 &lt;td&gt;It permits NULL authentication (usually used with &apos;-l&apos;, that
<a name="l00103"></a>00103 guarantees that only the allowed hosts can connect to the daemon).
<a name="l00104"></a>00104 Default: the username/password authentication mechanism is required.&lt;/td&gt;
<a name="l00105"></a>00105 &lt;/tr&gt;
<a name="l00106"></a>00106 &lt;tr&gt;
<a name="l00107"></a>00107 &lt;td&gt;
<a name="l00108"></a>00108 &lt;pre&gt;-a &amp;lt;host, port&amp;gt;&lt;/pre&gt;
<a name="l00109"></a>00109 &lt;/td&gt;
<a name="l00110"></a>00110 &lt;td&gt;It forces the daemon to run in active mode and to connect to &apos;host&apos; on
<a name="l00111"></a>00111 port &apos;port&apos;. This does not exclude that the daemon is still able to
<a name="l00112"></a>00112 accept passive connections.&lt;/td&gt;
<a name="l00113"></a>00113 &lt;/tr&gt;
<a name="l00114"></a>00114 &lt;tr&gt;
<a name="l00115"></a>00115 &lt;td&gt;
<a name="l00116"></a>00116 &lt;pre&gt;-v&lt;/pre&gt;
<a name="l00117"></a>00117 &lt;/td&gt;
<a name="l00118"></a>00118 &lt;td&gt;It forces the daemon to run in active mode only (default: the daemon
<a name="l00119"></a>00119 always accepts active connections, even if the &apos;-a&apos; switch is
<a name="l00120"></a>00120 specified).&lt;/td&gt;
<a name="l00121"></a>00121 &lt;/tr&gt;
<a name="l00122"></a>00122 &lt;tr&gt;
<a name="l00123"></a>00123 &lt;td&gt;
<a name="l00124"></a>00124 &lt;pre&gt;-d&lt;/pre&gt;
<a name="l00125"></a>00125 &lt;/td&gt;
<a name="l00126"></a>00126 &lt;td&gt;Forces the daemon to run in background, i.e. as a daemon (UNIX only)
<a name="l00127"></a>00127 or as a service (Win32 only). &lt;b&gt;Warning&lt;/b&gt; (Win32): this switch is
<a name="l00128"></a>00128 provided automatically when WinPcap installs this daemon into the Win32
<a name="l00129"></a>00129 services (control panel - administrative tools - services).&lt;/td&gt;
<a name="l00130"></a>00130 &lt;/tr&gt;
<a name="l00131"></a>00131 &lt;tr&gt;
<a name="l00132"></a>00132 &lt;td&gt;
<a name="l00133"></a>00133 &lt;pre&gt;-s &amp;lt;file&amp;gt;&lt;/pre&gt;
<a name="l00134"></a>00134 &lt;/td&gt;
<a name="l00135"></a>00135 &lt;td&gt;It saves the current configuration to file.&lt;/td&gt;
<a name="l00136"></a>00136 &lt;/tr&gt;
<a name="l00137"></a>00137 &lt;tr&gt;
<a name="l00138"></a>00138 &lt;td&gt;
<a name="l00139"></a>00139 &lt;pre&gt;-f &amp;lt;file&amp;gt;&lt;/pre&gt;
<a name="l00140"></a>00140 &lt;/td&gt;
<a name="l00141"></a>00141 &lt;td&gt;It loads the current configuration from file; all the switches
<a name="l00142"></a>00142 specified from the command line are ignored and the file settings are
<a name="l00143"></a>00143 used instead.&lt;/td&gt;
<a name="l00144"></a>00144 &lt;/tr&gt;
<a name="l00145"></a>00145 &lt;tr&gt;
<a name="l00146"></a>00146 &lt;td&gt;
<a name="l00147"></a>00147 &lt;pre&gt;-h&lt;/pre&gt;
<a name="l00148"></a>00148 &lt;/td&gt;
<a name="l00149"></a>00149 &lt;td&gt;It prints an help screen.&lt;/td&gt;
<a name="l00150"></a>00150 &lt;/tr&gt;
<a name="l00151"></a>00151 &lt;/table&gt;
<a name="l00152"></a>00152 &lt;/div&gt;
<a name="l00153"></a>00153 &lt;h3&gt;Installing the remote daemon&lt;/h3&gt;
<a name="l00154"></a>00154 &lt;p&gt;The remote daemon is installed automatically when installing WinPcap. The
<a name="l00155"></a>00155 installation process places the &lt;code&gt;rpcapd&lt;/code&gt; file into the &lt;code&gt;WinPcap&lt;/code&gt;
<a name="l00156"></a>00156 folder. This file can be executed either from the command line, or as a service.
<a name="l00157"></a>00157 For instance, the installation process updates the list of available services
<a name="l00158"></a>00158 list and it creates a new item (&lt;b&gt;Remote Packet Capture Protocol v.0
<a name="l00159"></a>00159 (experimental)&lt;/b&gt; ). To avoid security problems, the service is inactive and it
<a name="l00160"></a>00160 has to be started manually (control panel - administrative tools - services -
<a name="l00161"></a>00161 start).&lt;/p&gt;
<a name="l00162"></a>00162 &lt;p&gt;The service has a set of &amp;quot;standard&amp;quot; parameters, i.e. it it launched
<a name="l00163"></a>00163 with the &amp;quot;&lt;code&gt;-d&lt;/code&gt;&amp;quot; flag (in orde to make it running as a
<a name="l00164"></a>00164 service) and the &amp;quot;&lt;code&gt;-f rpcapd.ini&lt;/code&gt;&amp;quot; flag. The user can
<a name="l00165"></a>00165 create a file called &lt;code&gt;rpcapd.ini&lt;/code&gt; in the same folder of the
<a name="l00166"></a>00166 executable, and put the configuration commands in there. In order for the
<a name="l00167"></a>00167 service to execute the commands, you have to stop and restart it again (i.e. the
<a name="l00168"></a>00168 initialization file is parsed only at the beginning). Viceversa, the UNIX
<a name="l00169"></a>00169 version of &lt;code&gt;rpcapd&lt;/code&gt; is able to read the configuration file when
<a name="l00170"></a>00170 sending a kill -HUP signal to it. In that case, all the existing connections
<a name="l00171"></a>00171 remain in place, while the new connections will be created according to the new
<a name="l00172"></a>00172 parameters.&lt;/p&gt;
<a name="l00173"></a>00173 &lt;p&gt;In case the user does not want to create the configuration file manually, it
<a name="l00174"></a>00174 can launch &lt;code&gt;rpcapd&lt;/code&gt; with the requested parameters plus the &amp;quot;&lt;code&gt;-s
<a name="l00175"></a>00175 filename&lt;/code&gt;&amp;quot; one. The daemon will parse all the parameters and save
<a name="l00176"></a>00176 them into the specified configuration file.&lt;/p&gt;
<a name="l00177"></a>00177 &lt;h3&gt;Starting the remote daemon as a standard executable&lt;/h3&gt;
<a name="l00178"></a>00178 &lt;p&gt;The &lt;code&gt;rpcapd&lt;/code&gt; executable can be launched directly, i.e. it can run
<a name="l00179"></a>00179 in the foreground as well (not as a daemon/service). The procedure is quite
<a name="l00180"></a>00180 simple: you have to invoke the executable from the command line with all the
<a name="l00181"></a>00181 requested parameters but the &amp;quot;&lt;code&gt;-d&lt;/code&gt;&amp;quot; flag. The capture
<a name="l00182"></a>00182 server will start in the foreground.&lt;/p&gt;
<a name="l00183"></a>00183 &lt;h2&gt;&lt;a name=&quot;StartCap&quot;&gt;&lt;/a&gt;Starting a capture on a remote machine&lt;/h2&gt;
<a name="l00184"></a>00184 &lt;p&gt;If you are using a tool that is already aware of the remote capture (like
<a name="l00185"></a>00185 Analyzer), everything is simple. The capture wizard will help you to locate the
<a name="l00186"></a>00186 appropriate interface on the remote machine.&lt;/p&gt;
<a name="l00187"></a>00187 &lt;p&gt;If your preferred tool is not aware of the remote capture, you can still use
<a name="l00188"></a>00188 the remote capture. In this case you have to read the next Section.&lt;/p&gt;
<a name="l00189"></a>00189 &lt;p&gt;&lt;b&gt;Be carefully&lt;/b&gt;: the capture server (&lt;code&gt;rpcapd&lt;/code&gt;) must be up and
<a name="l00190"></a>00190 running on the remote machine.&lt;/p&gt;
<a name="l00191"></a>00191 &lt;h3&gt;New <span class="keywordtype">string</span> specifiers for interface selection&lt;/h3&gt;
<a name="l00192"></a>00192 &lt;p&gt;If your preferred tool is not aware of the remote capture, the only thing you
<a name="l00193"></a>00193 must do is to insert, as interface specifier, the indication of the remote
<a name="l00194"></a>00194 machine you want to contact. The following forms are allowed:&lt;/p&gt;
<a name="l00195"></a>00195 &lt;div align=&quot;left&quot;&gt;
<a name="l00196"></a>00196 &lt;table border=&quot;1&quot;&gt;
<a name="l00197"></a>00197 &lt;tr&gt;
<a name="l00198"></a>00198 &lt;th&gt;Adapter String&lt;/th&gt;
<a name="l00199"></a>00199 &lt;th&gt;Description&lt;/th&gt;
<a name="l00200"></a>00200 &lt;/tr&gt;
<a name="l00201"></a>00201 &lt;tr&gt;
<a name="l00202"></a>00202 &lt;td&gt;
<a name="l00203"></a>00203 &lt;pre&gt;file:<span class="comment">//filename&lt;/pre&gt;</span>
<a name="l00204"></a>00204 &lt;/td&gt;
<a name="l00205"></a>00205 &lt;td&gt;It opens a local file.&lt;/td&gt;
<a name="l00206"></a>00206 &lt;/tr&gt;
<a name="l00207"></a>00207 &lt;tr&gt;
<a name="l00208"></a>00208 &lt;td&gt;
<a name="l00209"></a>00209 &lt;pre&gt;rpcap:<span class="comment">//host.foo.bar/adaptername&lt;/pre&gt;</span>
<a name="l00210"></a>00210 &lt;/td&gt;
<a name="l00211"></a>00211 &lt;td&gt;It opens a remote adapter; the host is specified by means of the
<a name="l00212"></a>00212 literal name, without port number (i.e. it uses the RPCAP default port).&lt;/td&gt;
<a name="l00213"></a>00213 &lt;/tr&gt;
<a name="l00214"></a>00214 &lt;tr&gt;
<a name="l00215"></a>00215 &lt;td&gt;
<a name="l00216"></a>00216 &lt;pre&gt;rpcap:<span class="comment">//host.foo.bar:1234/adaptername&lt;/pre&gt;</span>
<a name="l00217"></a>00217 &lt;/td&gt;
<a name="l00218"></a>00218 &lt;td&gt;It is the same as before, but it uses a different port number.&lt;/td&gt;
<a name="l00219"></a>00219 &lt;/tr&gt;
<a name="l00220"></a>00220 &lt;tr&gt;
<a name="l00221"></a>00221 &lt;td&gt;
<a name="l00222"></a>00222 &lt;pre&gt;rpcap:<span class="comment">//10.11.12.13/adaptername&lt;/pre&gt;</span>
<a name="l00223"></a>00223 &lt;/td&gt;
<a name="l00224"></a>00224 &lt;td&gt;It opens a remote adapter, but the host is specified by means of an
<a name="l00225"></a>00225 IPv4 numeric address, without port number (i.e. it uses the RPCAP
<a name="l00226"></a>00226 default port).&lt;/td&gt;
<a name="l00227"></a>00227 &lt;/tr&gt;
<a name="l00228"></a>00228 &lt;tr&gt;
<a name="l00229"></a>00229 &lt;td&gt;
<a name="l00230"></a>00230 &lt;pre&gt;rpcap:<span class="comment">//10.11.12.13:1234/adaptername&lt;/pre&gt;</span>
<a name="l00231"></a>00231 &lt;/td&gt;
<a name="l00232"></a>00232 &lt;td&gt;It is the same as before, but it uses a different port number.&lt;/td&gt;
<a name="l00233"></a>00233 &lt;/tr&gt;
<a name="l00234"></a>00234 &lt;tr&gt;
<a name="l00235"></a>00235 &lt;td&gt;
<a name="l00236"></a>00236 &lt;pre&gt;rpcap:<span class="comment">//[10.11.12.13]:1234/adaptername&lt;/pre&gt;</span>
<a name="l00237"></a>00237 &lt;/td&gt;
<a name="l00238"></a>00238 &lt;td&gt;It is the same as before, but the numeric address is specified within
<a name="l00239"></a>00239 square brackets (like IPv6 addresses).&lt;/td&gt;
<a name="l00240"></a>00240 &lt;/tr&gt;
<a name="l00241"></a>00241 &lt;tr&gt;
<a name="l00242"></a>00242 &lt;td&gt;
<a name="l00243"></a>00243 &lt;pre&gt;rpcap:<span class="comment">//[1:2:3::4]/adaptername&lt;/pre&gt;</span>
<a name="l00244"></a>00244 &lt;/td&gt;
<a name="l00245"></a>00245 &lt;td&gt;It opens a remote adapter, but the host is specified by means of an
<a name="l00246"></a>00246 IPv6 numeric address, without port number (i.e. it uses the RPCAP
<a name="l00247"></a>00247 default port). In case of IPv6 addresses you MUST use the square
<a name="l00248"></a>00248 brackets.&lt;/td&gt;
<a name="l00249"></a>00249 &lt;/tr&gt;
<a name="l00250"></a>00250 &lt;tr&gt;
<a name="l00251"></a>00251 &lt;td&gt;
<a name="l00252"></a>00252 &lt;pre&gt;rpcap:<span class="comment">//[1:2:3::4]:1234/adaptername&lt;/pre&gt;</span>
<a name="l00253"></a>00253 &lt;/td&gt;
<a name="l00254"></a>00254 &lt;td&gt;It is the same as before, but it uses a different port number.&lt;/td&gt;
<a name="l00255"></a>00255 &lt;/tr&gt;
<a name="l00256"></a>00256 &lt;tr&gt;
<a name="l00257"></a>00257 &lt;td&gt;
<a name="l00258"></a>00258 &lt;pre&gt;rpcap:<span class="comment">//adaptername&lt;/pre&gt;</span>
<a name="l00259"></a>00259 &lt;/td&gt;
<a name="l00260"></a>00260 &lt;td&gt;It opens a local adapter, without using the RPCAP protocol.&lt;/td&gt;
<a name="l00261"></a>00261 &lt;/tr&gt;
<a name="l00262"></a>00262 &lt;tr&gt;
<a name="l00263"></a>00263 &lt;td&gt;
<a name="l00264"></a>00264 &lt;pre&gt;adaptername&lt;/pre&gt;
<a name="l00265"></a>00265 &lt;/td&gt;
<a name="l00266"></a>00266 &lt;td&gt;It opens a local adapter; it is kept for compability, but it is
<a name="l00267"></a>00267 strongly discouraged.&lt;/td&gt;
<a name="l00268"></a>00268 &lt;/tr&gt;
<a name="l00269"></a>00269 &lt;tr&gt;
<a name="l00270"></a>00270 &lt;td&gt;
<a name="l00271"></a>00271 &lt;pre&gt;(NULL)&lt;/pre&gt;
<a name="l00272"></a>00272 &lt;/td&gt;
<a name="l00273"></a>00273 &lt;td&gt;It opens the first local adapter; it is kept for compability, but it
<a name="l00274"></a>00274 is strongly discouraged.&lt;/td&gt;
<a name="l00275"></a>00275 &lt;/tr&gt;
<a name="l00276"></a>00276 &lt;/table&gt;
<a name="l00277"></a>00277 &lt;/div&gt;
<a name="l00278"></a>00278 &lt;p&gt;The following formats are not allowed:&lt;/p&gt;
<a name="l00279"></a>00279 &lt;table border=&quot;1&quot;&gt;
<a name="l00280"></a>00280 &lt;tr&gt;
<a name="l00281"></a>00281 &lt;th&gt;Adapter String&lt;/th&gt;
<a name="l00282"></a>00282 &lt;th&gt;Description&lt;/th&gt;
<a name="l00283"></a>00283 &lt;/tr&gt;
<a name="l00284"></a>00284 &lt;tr&gt;
<a name="l00285"></a>00285 &lt;td&gt;
<a name="l00286"></a>00286 &lt;pre&gt;rpcap:<span class="comment">//&lt;/pre&gt;</span>
<a name="l00287"></a>00287 &lt;/td&gt;
<a name="l00288"></a>00288 &lt;td&gt;It cannot be used to open the first local adapter.&lt;/td&gt;
<a name="l00289"></a>00289 &lt;/tr&gt;
<a name="l00290"></a>00290 &lt;tr&gt;
<a name="l00291"></a>00291 &lt;td&gt;
<a name="l00292"></a>00292 &lt;pre&gt;rpcap:<span class="comment">//hostname/&lt;/pre&gt;</span>
<a name="l00293"></a>00293 &lt;/td&gt;
<a name="l00294"></a>00294 &lt;td&gt;It cannot be used to open the first remote adapter.&lt;/td&gt;
<a name="l00295"></a>00295 &lt;/tr&gt;
<a name="l00296"></a>00296 &lt;/table&gt;
<a name="l00297"></a>00297 &lt;h2&gt;&lt;a name=&quot;UNIX&quot;&gt;&lt;/a&gt;Installing the Remote Capture <a class="code" href="wpcap__remote_8htm.html#a258f021c7879aa3b45bdf4d6e922d4f1">Daemon</a> in UNIX&lt;/h2&gt;
<a name="l00298"></a>00298 &lt;p&gt;The WinPcap source archive can be compiled in UNIX as well. Currently, remote
<a name="l00299"></a>00299 capture has been tested on Linux and BSD. What you have to do is:&lt;/p&gt;
<a name="l00300"></a>00300 &lt;ul&gt;
<a name="l00301"></a>00301 &lt;li&gt;download the WinPcap sources&lt;/li&gt;
<a name="l00302"></a>00302 &lt;li&gt;unpack the sources
<a name="l00303"></a>00303 &lt;ul&gt;
<a name="l00304"></a>00304 &lt;li&gt;we suggest to use the &lt;code&gt;unzip -a&lt;/code&gt; command in order to
<a name="l00305"></a>00305 convert DOS files to UNIX ones&lt;/li&gt;
<a name="l00306"></a>00306 &lt;/ul&gt;
<a name="l00307"></a>00307 &lt;/li&gt;
<a name="l00308"></a>00308 &lt;li&gt;move to the &lt;code&gt;libpcap&lt;/code&gt; folder&lt;/li&gt;
<a name="l00309"></a>00309 &lt;li&gt;type:
<a name="l00310"></a>00310 &lt;ul&gt;
<a name="l00311"></a>00311 &lt;li&gt;&lt;code&gt;./configure&lt;/code&gt;&lt;/li&gt;
<a name="l00312"></a>00312 &lt;li&gt;&lt;b&gt;Warning&lt;/b&gt;: in case the previous step reports an error, please
<a name="l00313"></a>00313 regenerate the &lt;code&gt;configure&lt;/code&gt; file using &lt;code&gt;automake&lt;/code&gt;
<a name="l00314"></a>00314 (version 2.50 or higher required)&lt;/li&gt;
<a name="l00315"></a>00315 &lt;li&gt;&lt;code&gt;make&lt;/code&gt;&lt;/li&gt;
<a name="l00316"></a>00316 &lt;/ul&gt;
<a name="l00317"></a>00317 &lt;/li&gt;
<a name="l00318"></a>00318 &lt;li&gt;move to the &lt;code&gt;rpcapd&lt;/code&gt; folder&lt;/li&gt;
<a name="l00319"></a>00319 &lt;li&gt;type &lt;code&gt;make&lt;/code&gt;&lt;/li&gt;
<a name="l00320"></a>00320 &lt;/ul&gt;
<a name="l00321"></a>00321 &lt;p&gt;The remote capture capabilities are turned on by default on Linux and
<a name="l00322"></a>00322 FreeBSD. In case you do not want remote capture capabilities in libpcap, you can
<a name="l00323"></a>00323 type&lt;/p&gt;
<a name="l00324"></a>00324 &lt;pre&gt; ./configure --disable-remote&lt;/pre&gt;
<a name="l00325"></a>00325 &lt;p&gt;at the &amp;quot;&lt;code&gt;configure&lt;/code&gt;&amp;quot; step. All the possible flags are
<a name="l00326"></a>00326 listed when typing &lt;code&gt;./configure --help&lt;/code&gt;.&lt;/p&gt;
<a name="l00327"></a>00327 &lt;p&gt;What you obtained right now, is:&lt;/p&gt;
<a name="l00328"></a>00328 &lt;ul&gt;
<a name="l00329"></a>00329 &lt;li&gt;a library file (&lt;code&gt;libpcap.a&lt;/code&gt;), which can be linked to other
<a name="l00330"></a>00330 applications (like &lt;code&gt;tcpdump&lt;/code&gt;) in order to enable the remote
<a name="l00331"></a>00331 capture for them.&lt;/li&gt;
<a name="l00332"></a>00332 &lt;li&gt;an executable (&lt;code&gt;rpcapd&lt;/code&gt;) that is the remote daemon&lt;/li&gt;
<a name="l00333"></a>00333 &lt;/ul&gt;
<a name="l00334"></a>00334 &lt;p&gt;&lt;b&gt;Warning&lt;/b&gt;: in order to run the &lt;code&gt;rpcapd&lt;/code&gt; daemon, the program
<a name="l00335"></a>00335 must either&lt;/p&gt;
<a name="l00336"></a>00336 &lt;ul&gt;
<a name="l00337"></a>00337 &lt;li&gt;run as root (or)&lt;/li&gt;
<a name="l00338"></a>00338 &lt;li&gt;run as user, but it must be owned by root and must be SUID root (&lt;code&gt;chmod
<a name="l00339"></a>00339 u+s rpcapd&lt;/code&gt;)&lt;/li&gt;
<a name="l00340"></a>00340 &lt;/ul&gt;
<a name="l00341"></a>00341 &lt;h3&gt;Known bugs&lt;/h3&gt;
<a name="l00342"></a>00342 &lt;p&gt;&lt;b&gt;FreeBSD&lt;/b&gt;: the first time you call the &lt;code&gt;<a class="code" href="structpcap__stat.html" title="Structure that keeps statistical values on an interface.">pcap_stat</a>()&lt;/code&gt;, the
<a name="l00343"></a>00343 function takes several seconds to return. Therefore, programs like Analyzer seem
<a name="l00344"></a>00344 to hang up for 20-30 seconds at the beginning of the capture (if this is done
<a name="l00345"></a>00345 with BSD as a remote probe). We&apos;re investigating to solve this issue.&lt;/p&gt;
<a name="l00346"></a>00346 &lt;p&gt;&lt;i&gt;For any question, please refer to the WinPcap help page.&lt;/i&gt;&lt;/p&gt;
<a name="l00347"></a>00347
<a name="l00348"></a>00348 &lt;/body&gt;
<a name="l00349"></a>00349
<a name="l00350"></a>00350 &lt;/html&gt;
</pre></div></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>