[Winpcap-users] pcap_sendpacket help

Daniel Wojcieszyk Daniel.Wojcieszyk at bielsko.evatronix.com.pl
Thu Aug 17 08:32:08 GMT 2006


Hi All,

I am new with winpcap. I try to build application in Visual C++ 2005
which use pcap_sendpacket method. I have to send Ethernet (MAC) frame
throw my Ethernet card to other device. The problem is that when I build
this frame and use following method, frame isn't received by other
devices. When I start Etherael on my machine I can see that packet was
send, but in other machine ethereal can't see any packets. Similar
situation is when I connect some HUB between my computer and other one
and I send some packets, I can see that green diode is blinking only in
hub port to which I am connected, but not in the rest of ports where
other computers are connected. It looks like this packet is not
forwarded to other ports. Frame which I build loks like frame from
sample from winpcap documentation:

			/* destination broadcast address*/
			packet[0]=0xFF;
			packet[1]=0xFF;
			packet[2]=0xFF;
			packet[3]=0xFF;
			packet[4]=0xFF;
			packet[5]=0xFF;
		    
			/* set mac source to 2:2:2:2:2:2 */
			packet[6]=2;
			packet[7]=2;
			packet[8]=2;
			packet[9]=2;
			packet[10]=2;
			packet[11]=2;
		    
			/* Fill the rest of the packet */
			for(i=12;i<100;i++)
			{
				packet[i]=i%256;
			}

			while(1)
			{
			/* Send down the packet */
			if (pcap_sendpacket(adhandle, packet, 100 /*
size */) !=0)
			{
				pcap_geterr(fp));
				return ;
			}

Function pcap_sendpacket doesn't return any error, it shows always that
packet was send correctly but in other computers I can't see them
anyway. When I get packets (send by other computers to mine machine)from
my card everythink works good, I can do this without any problems. IS
anybody who can help me to solve this problem? 

Thank you all.

Best greats,
Daniel.



More information about the Winpcap-users mailing list