<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE>.hmmessage P {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
        FONT-SIZE: 10pt; FONT-FAMILY: Tahoma
}
</STYLE>
<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY class=hmmessage bgColor=#ffffff>
<DIV><FONT face="Courier New">There's no direct way to do that, because there's
no "perfect" interface on which all your traffic goes through. In case of IP
traffic, for example, the TCP/IP protocol stack decides the best interface to
use to send the traffic. In the simple case (one adapter), just list the
adapters and pick the one with an IP address associated with it. In the worst
case, you will need to sniff from all the interfaces. I simply don't understand
the problem of having a thread that is sitting there capturing on an adapter
that doesn't receive any traffic. </FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">Hope this helps</FONT></DIV>
<DIV><FONT face="Courier New">GV</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">PS: please do *not* reply to the digest messages.
Either reply to the original messages or at least change the subject of your
email to match the one of the original message you are replying to.</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </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=farhanhbk@hotmail.com href="mailto:farhanhbk@hotmail.com">*farhan
Khan*</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> Wednesday, November 14, 2007 5:03
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] RE:
Winpcap-users Digest, Vol 32, Issue 6</DIV>
<DIV><BR></DIV><BR>Thanks for your replies guys , but the problem is still
remain. Suppose if i create an application which work in background to capture
only URLS.Then i dont want my client to select the adapter by himself ,
70% of commercial users are not technichal so instead of telling them to
select their approperiate adapter for capturing packets seems not OK with my
specifications. Plus i cant run two modules of winpcap on a system if i will
do that then suppose a person has 3 adapter one genric dilaup, other twos are
LAN ethernet and WAN then it became like 3 threads which will work on
all of these adapters to capture the TCP IP data, while one of them will
be working. So thats why i want that application to detect itself that which
adapter is currently perfect to catch the data. Hope you guys got the idea of
it now??<BR> <BR>Also my OS is winxp<BR> <BR><BR>> Date: Wed, 14
Nov 2007 12:00:55 +0000<BR>> From:
winpcap-users-request@winpcap.org<BR>> Subject: Winpcap-users Digest, Vol
32, Issue 6<BR>> To: winpcap-users@winpcap.org<BR>> <BR>> Send
Winpcap-users mailing list submissions to<BR>>
winpcap-users@winpcap.org<BR>> <BR>> To subscribe or unsubscribe via the
World Wide Web, visit<BR>>
https://www.winpcap.org/mailman/listinfo/winpcap-users<BR>> or, via email,
send a message with subject or body 'help' to<BR>>
winpcap-users-request@winpcap.org<BR>> <BR>> You can reach the person
managing the list at<BR>> winpcap-users-owner@winpcap.org<BR>> <BR>>
When replying, please edit your Subject line so it is more specific<BR>>
than "Re: Contents of Winpcap-users digest..."<BR>> <BR>> <BR>>
Today's Topics:<BR>> <BR>> 1. how to auto detect the interface (*farhan
Khan*)<BR>> 2. Re: how to auto detect the interface (David Chang)<BR>>
3. Re: how to auto detect the interface (Gianluca Varenni)<BR>> <BR>>
<BR>>
----------------------------------------------------------------------<BR>>
<BR>> Message: 1<BR>> Date: Tue, 13 Nov 2007 19:29:07 +0000<BR>>
From: *farhan Khan* <farhanhbk@hotmail.com><BR>> Subject:
[Winpcap-users] how to auto detect the interface<BR>> To:
<winpcap-users@winpcap.org><BR>> Message-ID:
<BAY143-W452462A9AD37388DF204AFBC800@phx.gbl><BR>> Content-Type:
text/plain; charset="windows-1252"<BR>> <BR>> <BR>> hi,<BR>> 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???<BR>> <BR>> <BR>> Regards<BR>>
Farhan<BR>>
_________________________________________________________________<BR>>
Windows Live Hotmail and Microsoft Office Outlook – together at last.
Get it now.<BR>>
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033<BR>>
-------------- next part --------------<BR>> An HTML attachment was
scrubbed...<BR>> URL:
http://www.winpcap.org/pipermail/winpcap-users/attachments/20071113/6c093f8a/attachment-0001.htm<BR>>
<BR>> ------------------------------<BR>> <BR>> Message: 2<BR>>
Date: Tue, 13 Nov 2007 14:22:56 -0800<BR>> From: "David Chang"
<dchang@fsautomation.com><BR>> Subject: Re: [Winpcap-users] how to
auto detect the interface<BR>> To:
<winpcap-users@winpcap.org><BR>> Message-ID:
<02ae01c82643$bdef9ac0$6b36a8c0@ace><BR>> Content-Type: text/plain;
charset="windows-1252"<BR>> <BR>> Farhan,<BR>> <BR>> Are you
asking how to translate a single IP address to a particular NIC? Or, do you
actually need to sample the packet stream because you have some kind of
SPAN/mirror port on a switch?<BR>> <BR>> By the way, which O.S. are you
writing this application for?<BR>> <BR>> DC<BR>> <BR>> -----
Original Message ----- <BR>> From: *farhan Khan* <BR>> To:
winpcap-users@winpcap.org <BR>> Sent: Tuesday, November 13, 2007 11:29
AM<BR>> Subject: [Winpcap-users] how to auto detect the interface<BR>>
<BR>> <BR>> hi,<BR>> 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???<BR>> <BR>> <BR>> Regards<BR>> Farhan<BR>> <BR>>
<BR>>
------------------------------------------------------------------------------<BR>>
Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it
now! <BR>> <BR>> <BR>>
------------------------------------------------------------------------------<BR>>
<BR>> <BR>> _______________________________________________<BR>>
Winpcap-users mailing list<BR>> Winpcap-users@winpcap.org<BR>>
https://www.winpcap.org/mailman/listinfo/winpcap-users<BR>> --------------
next part --------------<BR>> An HTML attachment was scrubbed...<BR>>
URL:
http://www.winpcap.org/pipermail/winpcap-users/attachments/20071113/d4053d15/attachment-0001.htm<BR>>
<BR>> ------------------------------<BR>> <BR>> Message: 3<BR>>
Date: Tue, 13 Nov 2007 14:46:57 -0800<BR>> From: "Gianluca Varenni"
<gianluca.varenni@cacetech.com><BR>> Subject: Re: [Winpcap-users] how
to auto detect the interface<BR>> To:
<winpcap-users@winpcap.org><BR>> Message-ID:
<070901c82647$18df25b0$1a4da8c0@NELSON2><BR>> Content-Type:
text/plain; charset="windows-1252"<BR>> <BR>> 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.<BR>> Things get much
more complicated if<BR>> 1. the machine has more than one adapter<BR>>
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.<BR>> <BR>> Hope it helps<BR>>
GV<BR>> ----- Original Message ----- <BR>> From: *farhan Khan* <BR>>
To: winpcap-users@winpcap.org <BR>> Sent: Tuesday, November 13, 2007 11:29
AM<BR>> Subject: [Winpcap-users] how to auto detect the interface<BR>>
<BR>> <BR>> hi,<BR>> 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???<BR>> <BR>> <BR>> Regards<BR>> Farhan<BR>> <BR>>
<BR>>
------------------------------------------------------------------------------<BR>>
Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it
now! <BR>> <BR>> <BR>>
------------------------------------------------------------------------------<BR>>
<BR>> <BR>> _______________________________________________<BR>>
Winpcap-users mailing list<BR>> Winpcap-users@winpcap.org<BR>>
https://www.winpcap.org/mailman/listinfo/winpcap-users<BR>> --------------
next part --------------<BR>> An HTML attachment was scrubbed...<BR>>
URL:
http://www.winpcap.org/pipermail/winpcap-users/attachments/20071113/227ed133/attachment-0001.htm<BR>>
<BR>> ------------------------------<BR>> <BR>>
_______________________________________________<BR>> Winpcap-users mailing
list<BR>> Winpcap-users@winpcap.org<BR>>
https://www.winpcap.org/mailman/listinfo/winpcap-users<BR>> <BR>>
<BR>> End of Winpcap-users Digest, Vol 32, Issue 6<BR>>
********************************************<BR><BR><BR>
<HR>
Boo! Scare away worms, viruses and so much more! Try Windows Live
OneCare! <A
href="http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews"
target=_new>Try 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>