<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello!<div><br></div><div>Gianluca, can u run this code on Your machine and running the Wireshark save the log and send it to me, please..</div><div>Is there any delays, i mean delays between the packets that Wireshark (winpcap) capture?</div><div><br></div><div>P.S. code from WinPcap documentation, sending packets, not one, but 10000 (or 1000000)..</div><div><br></div><div><pre class="fragment"><span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<span class="preprocessor">#include &lt;stdio.h&gt;</span>

<span class="preprocessor">#include &lt;pcap.h&gt;</span>


<span class="keywordtype">void</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)
{
<a class="code" href="http://www.winpcap.org/docs/docs_412/html/group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *fp;
<span class="keywordtype">char</span> errbuf[<a class="code" href="http://www.winpcap.org/docs/docs_412/html/group__wpcap__def.html#gacd448353957d92c98fccc29e1fc8d927" title="Size to use when allocating the buffer that contains the libpcap errors.">PCAP_ERRBUF_SIZE</a>];
u_char packet[100];
<span class="keywordtype">int</span> i;</pre><pre class="fragment">volatile int n_pkts = 10000; // 1000000

    <span class="comment">/* Check the validity of the command line */</span>
    <span class="keywordflow">if</span> (argc != 2)
    {
        printf(<span class="stringliteral">"usage: %s interface (e.g. 'rpcap://eth0')"</span>, argv[0]);
        <span class="keywordflow">return</span>;
    }
    
    <span class="comment">/* Open the output device */</span>
    <span class="keywordflow">if</span> ( (fp= <a class="code" href="http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga2b64c7b6490090d1d37088794f1f1791" title="Open a generic source in order to capture / send (WinPcap only) traffic.">pcap_open</a>(argv[1],            <span class="comment">// name of the device</span>
                        65536,                <span class="comment">// portion of the packet to capture (only the first 100 bytes)</span>
                        <a class="code" href="http://www.winpcap.org/docs/docs_412/html/group__remote__open__flags.html#ga9134ce51a9a6a7d497c3dee5affdc3b9" title="Defines if the adapter has to go in promiscuous mode.">PCAP_OPENFLAG_PROMISCUOUS</a>,  <span class="comment">// promiscuous mode</span>
                        1000,               <span class="comment">// read timeout</span>
                        NULL,               <span class="comment">// authentication on the remote machine</span>
                        errbuf              <span class="comment">// error buffer</span>
                        ) ) == NULL)
    {
        fprintf(stderr,<span class="stringliteral">"\nUnable to open the adapter. %s is not supported by WinPcap\n"</span>, argv[1]);
        <span class="keywordflow">return</span>;
    }

    <span class="comment">/* Supposing to be on ethernet, set mac destination to 1:1:1:1:1:1 */</span>
    packet[0]=1;
    packet[1]=1;
    packet[2]=1;
    packet[3]=1;
    packet[4]=1;
    packet[5]=1;
    
    <span class="comment">/* set mac source to 2:2:2:2:2:2 */</span>
    packet[6]=2;
    packet[7]=2;
    packet[8]=2;
    packet[9]=2;
    packet[10]=2;
    packet[11]=2;
    
    <span class="comment">/* Fill the rest of the packet */</span>
    <span class="keywordflow">for</span>(i=12;i&lt;100;i++)
    {
        packet[i]=(u_char)i;
    }
<br></pre><pre class="fragment">    while (n_pkts--)
    <span class="comment">/* Send down the packet */</span>
    <span class="keywordflow">if</span> (<a class="code" href="http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga51dbda0f1ab9da2cfe49d657486d50b2" title="Send a raw packet.">pcap_sendpacket</a>(fp, packet, 100 <span class="comment">/* size */</span>) != 0)
    {
        fprintf(stderr,<span class="stringliteral">"\nError sending the packet: %s\n"</span>, <a class="code" href="http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga81305cb154e4497e95bbb9b708631a3a" title="return the error text pertaining to the last pcap library error.">pcap_geterr</a>(fp));
        <span class="keywordflow">return</span>;
    }

    <span class="keywordflow">return</span>;
}
</pre><pre class="fragment">/* EOF */</pre><pre class="fragment">Thanks, bye..</pre><pre class="fragment"><br></pre><div><br></div></div></body></html>