may be its being discarded by NIC driver. better check structure of packet. I have faced similar problem. <br><br><div class="gmail_quote">On Sat, May 28, 2011 at 9:34 PM, Nawel Souissi <span dir="ltr"><<a href="mailto:nawelsouissi@yahoo.fr">nawelsouissi@yahoo.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt">
<div>Hello,<br><br>i'am using winpcap in my project.<br>i want to send packets from one computer to another computer.<br><br>i
developped a transmitter application that uses winpcap to send packets
to my NIC interface, and a receiver application that capture packets
from NIC interface in another computer using winpcap.<br>the two cards are related with a cross wire.<br><br>but
i have a problem here: the transmitter application prints "Packet is
sent" but my receiver doesn't receive this packet (that i have sent)!!<br>i tested the receiver application and it works well if i relate it with another network.<br>the connexion between two cards is working well also i tested it with ping.<br>
<br>i
even tried with wireshark, i sent a packet to my NIC interface and i
started wireshark (installed in the same computer) and i want him to
capture from this NIC interface but he prints "no packets". means that
packets are dropped before reaching the Ethernet card!!<br><br>i really need your help!! why my packets can't reach my Ethernet card?<br>this is my transmitter code:<br><br>pcap_if_t* ChosenDevice;<br> pcap_t *fp;<br>
const char *InterfaceName;<br> char errbuf[PCAP_ERRBUF_SIZE];<br> int i = 1;<br><br> pcap_findalldevs_ex(PCAP_SRC_IF_STRING,NULL,&ChosenDevice,errbuf);<br> for(pcap_if_t* CurrentDevice = ChosenDevice;CurrentDevice != NULL;CurrentDevice = CurrentDevice->next)<br>
{<br> cout<<i << ". "<< CurrentDevice->description << endl;<br> i++;<br> }<br> <br> int
chosen;<br> cin >> chosen;<br><br> if ( (fp= pcap_open(ChosenDevice->name, <br> 1500,
<br> PCAP_OPENFLAG_PROMISCUOUS, <br> 1000, // read timeout<br> NULL, // authentication on the remote
machine<br> errbuf //
error buffer<br> ) ) == NULL)<br> {<br> fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", InterfaceName);<br> <br> }<br>if(pcap_sendpacket(fp,Frame,Framesize)==0)<br>
cout<<"packet is sent"<<endl;<br><br>and i used these functions is my receiver code:<br><br>pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf);<br> pcap_handle=pcap_open_live(d->name,20480,1,0,errbuf);<br>
pcap_next_ex( pcap_handle, &paquet_header, &Paquet_Ethernet);<br><br><br>i think that i have a problem with some parameter in winpcap functions.<br>so how can i solve my
problem?<br></div></div></div><br>_______________________________________________<br>
Winpcap-users mailing list<br>
<a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br>
<a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Your smile is the most precious thing that doesn't cost you. Keep smiling. :)<br>===============<br> SunilKumar<div>------------------------------</div><div><a href="http://in.linkedin.com/in/sunilkr86/" title="View public profile" name="SafeHtmlFilter_webProfileURL" target="_blank">http://in.linkedin.com/in/sunilkr86/</a><br>
===============</div><br>