<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt">Thanks,<br><br>Actually the idea developed a little after I posted the message, that I didn't have the time to try thoroughly yet, was to have an infinte loop and a flag : when something that I detect in my package is present, it launches the packet sending, and until the flag is set down again I should not lose any passing packages....it was an advice I received, I still need the information from capture to pass into the send , so I don't exactly know how I'll be using a structure or something like that in C.... but the idea was to use pcap_loop() with 1 package only...I'll give pcap_next a try too....It's all a bit fuzzy since I'm new to WinPcap and don't know how much I can take advantage of all of its functionalities.<br><br>Thank you very much, you help was much needed,<br><br>Cri<div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Gianluca Varenni &lt;gianluca.varenni@cacetech.com&gt;<br>To: winpcap-users@winpcap.org<br>Sent: Tuesday, February 26, 2008 6:38:48 PM<br>Subject: Re: [Winpcap-users] capture AND send packets on same device<br><br>


 
<style type="text/css">DIV {
MARGIN:0px;}
</style>


<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="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
  <div style="background: rgb(228, 228, 228) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>From:</b> 
  <a rel="nofollow" title="fullmoon_2011@yahoo.com" ymailto="mailto:fullmoon_2011@yahoo.com" target="_blank" href="mailto:fullmoon_2011@yahoo.com">Cristina Ruxandra Ionescu</a> </div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a rel="nofollow" title="winpcap-users@winpcap.org" ymailto="mailto:winpcap-users@winpcap.org" target="_blank" href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</a> </div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Tuesday, February 26, 2008 8:44 
  AM</div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><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 rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20">Try 
  it now.</a>
  <p>
  </p><SPAN style="width:100%;height:2px;border-bottom:1px solid rgb(212,208,200); border-top:1px solid rgb(128,128,128);background-color:black;overflow:hidden; margin:8px 0px;"></SPAN>

  <p></p>_______________________________________________<br>Winpcap-users 
  mailing 
  list<br>Winpcap-users@winpcap.org<br><a target="_blank" href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br></blockquote><!-- kill --><div><br><br>-----Inline Attachment Follows-----<br><br>_______________________________________________<br>Winpcap-users 
mailing 
list<br><a ymailto="mailto:Winpcap-users@winpcap.org" 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></div></div><br></div></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></body></html>