<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16625"></HEAD>
<BODY 
style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; WORD-WRAP: break-word; PADDING-TOP: 15px; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space" 
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true" 
name="Compose message area">
<DIV><FONT face=Calibri>Alimjan,</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>what is the result that you get with this test? 
</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>GV</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A 
title="mailto:alimjankuramshin@gmail.com&#10;CTRL + Click to follow link" 
href="mailto:alimjankuramshin@gmail.com">Alimjan Kuramshin</A> </DIV>
<DIV><B>Sent:</B> Saturday, September 18, 2010 2:32 PM</DIV>
<DIV><B>To:</B> <A 
title="mailto:winpcap-users@winpcap.org&#10;CTRL + Click to follow link" 
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV><B>Subject:</B> [Winpcap-users] WinPCAP packets capture 
delay..</DIV></DIV></DIV>
<DIV><BR></DIV>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 title="Descriptor of an open capture instance. This structure is opaque to the user, that..." href="http://www.winpcap.org/docs/docs_412/html/group__wpcap__def.html#ga4711d025f83503ce692efa5e45ec60a7">pcap_t</A> *fp;
<SPAN class=keywordtype>char</SPAN> errbuf[<A class=code title="Size to use when allocating the buffer that contains the libpcap errors." href="http://www.winpcap.org/docs/docs_412/html/group__wpcap__def.html#gacd448353957d92c98fccc29e1fc8d927">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 title="Open a generic source in order to capture / send (WinPcap only) traffic." href="http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga2b64c7b6490090d1d37088794f1f1791">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 title="Defines if the adapter has to go in promiscuous mode." href="http://www.winpcap.org/docs/docs_412/html/group__remote__open__flags.html#ga9134ce51a9a6a7d497c3dee5affdc3b9">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 title="Send a raw packet." href="http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga51dbda0f1ab9da2cfe49d657486d50b2">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 title="return the error text pertaining to the last pcap library error." href="http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga81305cb154e4497e95bbb9b708631a3a">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>
<P>
<HR>

<P></P>_______________________________________________<BR>Winpcap-users mailing 
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BODY></HTML>