<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE type=text/css>DIV {
        MARGIN: 0px
}
</STYLE>

<META content="MSHTML 6.00.6000.16608" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Cristina,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>the easiest way to solve your problem is open the pcap device 
twice, one for transmission and one for reception, and then use two threads, one 
to capture packets and the other one to send packets.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Also, I suggest you to use pcap_next_ex instead of pcap_loop. 
It's much easier to stop the capture thread if you use pcap_next_ex</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Hope it helps</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=fullmoon_2011@yahoo.com 
  href="mailto:fullmoon_2011@yahoo.com">Cristina Ruxandra Ionescu</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org 
  href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, February 26, 2008 8:44 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] capture AND send 
  packets on same device</DIV>
  <DIV><BR></DIV>
  <DIV 
  style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">hello 
  everyone,<BR><BR>I have been looking for a way to do the following: use the 
  same device&nbsp; chosen from the list using <SPAN 
  style="FONT-WEIGHT: bold; FONT-STYLE: italic">pcap_findalldevs()</SPAN> for 
  both capturing packets and sending packets to the identified MAC on the other 
  end of my PC (a small card liked through Ethernet ). <BR><BR>My problem is 
  that <SPAN 
  style="FONT-WEIGHT: bold; FONT-STYLE: italic">pcap_loop()</SPAN><SPAN 
  style="FONT-WEIGHT: bold"> l</SPAN>oops..forever unless there is an error in 
  my case, and while I would like to send something to the other end, I would 
  like not to lose the existing sniff of the device in order not to lose track 
  of the packets exchanged. (have pcap_loop() and pcap_sendpacket() at once on 
  same device) .What I do more specifically is identify MACs of the two 
  sides&nbsp; and want to further download data onto a RAM on the device outside 
  the PC. How can I do that while still seing my firmware packets and the ACKs 
  ...? <BR><BR>I seem to find only one other reference of such a question ever 
  being asked in your mailing lists and other forums, so I'd really appreciate 
  your help. If I'm unclear I''m here to clear up whatever it is.<BR><BR>Thanks 
  in advance<BR>
  <DIV>&nbsp;</DIV><SPAN 
  style="FONT-FAMILY: times new roman,new york,times,serif"><SPAN 
  style="FONT-WEIGHT: bold">Cri</SPAN></SPAN></DIV><BR>
  <HR SIZE=1>
  Be a better friend, newshound, and know-it-all with Yahoo! Mobile. <A 
  href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ ">Try 
  it now.</A>
  <P>
  <HR>

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