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

Cristina Ruxandra Ionescu fullmoon_2011 at yahoo.com
Wed Feb 27 07:59:58 GMT 2008


Thanks,

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.

Thank you very much, you help was much needed,

Cri

----- Original Message ----
From: Gianluca Varenni <gianluca.varenni at cacetech.com>
To: winpcap-users at winpcap.org
Sent: Tuesday, February 26, 2008 6:38:48 PM
Subject: Re: [Winpcap-users] capture AND send packets on same device




 
DIV {
MARGIN:0px;}



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


-----Inline Attachment Follows-----

_______________________________________________
Winpcap-users 
mailing 
list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users







      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20080227/34579853/attachment.htm


More information about the Winpcap-users mailing list