[Winpcap-users] how to auto detect the interface

Gianluca Varenni gianluca.varenni at cacetech.com
Tue Nov 13 22:46:57 GMT 2007


You will need some heuristics to do that. If what you are interested in is IP traffic, I would probably list the adapters with their associated IP addresses. In the simple case (a machine with just one wired or wireless connection), you will get two (or three) adapters and only one of them will have a (valid) IP address associated to the adapter. And you will pick that one.
Things get much more complicated if
1. the machine has more than one adapter
2. (a special case of 1.) the machine has a wired and a wireless adapter (all the modern laptops have both), and the user switches often between the adapters (or use both of them at the same time). In this case you will need to capture from both the adapters.

Hope it helps
GV
  ----- Original Message ----- 
  From: *farhan Khan* 
  To: winpcap-users at winpcap.org 
  Sent: Tuesday, November 13, 2007 11:29 AM
  Subject: [Winpcap-users] how to auto detect the interface


  hi,
  i am new user of this mail list, i would like to know how can i detect which interface is the correct one to capture the packets on TCP 8080/80 and 1080 etc. I want my application to select approperiate interface automatically without user's input for the interface.... Is this possible if yes then please let me know how can i do that???
   
   
  Regards
  Farhan


------------------------------------------------------------------------------
  Windows Live Hotmail and Microsoft Office Outlook – together at last. Get 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/20071113/227ed133/attachment.htm


More information about the Winpcap-users mailing list