[Winpcap-users] capture AND send packets on same device

Gianluca Varenni gianluca.varenni at cacetech.com
Tue Feb 26 17:38:48 GMT 2008


Cristina,

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.

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

Hope it helps
GV

  ----- Original Message ----- 
  From: Cristina Ruxandra Ionescu 
  To: winpcap-users at winpcap.org 
  Sent: Tuesday, February 26, 2008 8:44 AM
  Subject: [Winpcap-users] capture AND send packets on same device


  hello everyone,

  I have been looking for a way to do the following: use the same device  chosen from the list using pcap_findalldevs() for both capturing packets and sending packets to the identified MAC on the other end of my PC (a small card liked through Ethernet ). 

  My problem is that pcap_loop() loops..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  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 ...? 

  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.

  Thanks in advance


  Cri


------------------------------------------------------------------------------
  Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.


------------------------------------------------------------------------------


  _______________________________________________
  Winpcap-users mailing list
  Winpcap-users at winpcap.org
  https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20080226/437af9cd/attachment.htm


More information about the Winpcap-users mailing list