[prev in list] [next in list] [prev in thread] [next in thread] 

List:       winpcap-users
Subject:    Fw: [Winpcap-users] Different results of pcap_findalldevs_ex
From:       <ceo () triplebit ! com>
Date:       2008-10-18 4:45:13
Message-ID: 02b701c930dc$51edd810$0b00000a () IVORYNEW
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks GV,
Here is a device list of all adapters. When using from the thread I miss the first \
one which is "...dialup and VPN...".  I do almost nothing that I attached later after \
the device list. Regards
I. lesher
device list
1.Adapter for generic dialup and VPN capture
2.CNet PRO200 PCI Fast Ethernet Adapter
3. Realtek RTLB139 Family Fast Ethernet Adapter
4. Realtek RTLB139 Family Fast Ethernet Adapter

the code before pcap_findalldevs -
void CDllPcapApp::Obtain_Device_List(void)

{

pcap_if_t *alldevs;

pcap_if_t *d;

int i=0;

char errbuf[PCAP_ERRBUF_SIZE];

pcap_t *adhandle;

u_int netmask;

char packet_filter[] = "ip";

struct bpf_program fcode;

/* Retrieve the device list from the local machine */

if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed */, &alldevs, \
errbuf) == -1)

{

fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf);

exit(1);

}

.

.


  What's the adapter which is missing?
  Are you calling/initializing any other component in that thread before calling \
pcap_findalldevs?

  Have a nice day
  GV

  ----- Original Message ----- 
    From: ceo@triplebit.com 
    To: winpcap-users@winpcap.org 
    Sent: Friday, October 17, 2008 1:35 AM
    Subject: [Winpcap-users] Different results of pcap_findalldevs_ex


    Hi all,
    Since no one answered my quetstion I'll do it again...

    I use pcap_findalldevs_ex from Dot Net application with Interoperability. I use \
it in different cases-  1. In one case I use it from a Winform which is the main \
thread object and I get 3 network devices.  2. In a second case I use it from a \
WorkerThread and I get only 2 network devices.  Is that normal and is there a way to \
eliminate the difference?

    Regards
    I. lesher


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


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


[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#00ffff>
<DIV><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV><FONT size=2>Thanks GV,</FONT></DIV>
<DIV><FONT size=2>Here is a device list of all adapters. When using from the 
thread I miss the first one which is "...dialup and VPN...". </FONT></DIV>
<DIV><FONT size=2>I do almost nothing that I attached later after the device 
list.</FONT></DIV>
<DIV><FONT size=2>Regards</FONT></DIV>
<DIV><FONT size=2>I. lesher</FONT></DIV>
<DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"></SPAN></DIV> <DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  face=Arial size=2>device list</FONT></SPAN></DIV>
<DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  face=Arial size=2>1.Adapter for generic dialup and VPN 
capture</FONT></SPAN></DIV>
<DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  face=Arial size=2>2.CNet PRO200 PCI Fast Ethernet \
Adapter</FONT></SPAN></DIV> <DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  face=Arial size=2>3. Realtek RTLB139 Family Fast \
Ethernet  Adapter</FONT></SPAN></DIV>
<DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  face=Arial size=2><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  face=Arial size=2>4. Realtek RTLB139 Family Fast \
Ethernet  Adapter</FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  face=Arial size=2>the code before pcap_findalldevs \
-</FONT></SPAN></DIV> <DIV><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: \
'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; \
mso-bidi-language: HE"><FONT  color=#0000ff size=2>
<P>void</FONT><FONT size=2> CDllPcapApp::Obtain_Device_List(</FONT><FONT 
color=#0000ff size=2>void</FONT><FONT size=2>)</P>
<P>{</P>
<P>pcap_if_t *alldevs;</P>
<P>pcap_if_t *d;</P>
<P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> i=0;</P>
<P></FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> 
errbuf[PCAP_ERRBUF_SIZE];</P>
<P>pcap_t *adhandle;</P>
<P>u_int netmask;</P>
<P></FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> packet_filter[] = 
</FONT><FONT color=#800000 size=2>"ip"</FONT><FONT size=2>;</P>
<P></FONT><FONT color=#0000ff size=2>struct</FONT><FONT size=2> bpf_program 
fcode;</P>
<P></FONT><FONT color=#008000 size=2>/* Retrieve the device list from the local 
machine */</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> 
(pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL </FONT><FONT color=#008000 
size=2>/* auth is not needed */</FONT><FONT size=2>, &amp;alldevs, errbuf) == 
-1)</P>
<P>{</P>
<P>fprintf(stderr,</FONT><FONT color=#800000 size=2>"Error in 
pcap_findalldevs_ex: %s\n"</FONT><FONT size=2>, errbuf);</P>
<P>exit(1);</P>
<P>}</P>
<P>.</P>
<P>.</P></FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 \
2px solid; MARGIN-RIGHT: 0px">  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>What's the adapter which is missing?</FONT></DIV>
  <DIV><FONT size=2>Are you calling/initializing any other component in that 
  thread before calling pcap_findalldevs?</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>Have a nice day</FONT></DIV>
  <DIV><FONT size=2>GV</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV>----- Original Message ----- </DIV>
  <BLOCKQUOTE 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: \
#000000 2px solid; MARGIN-RIGHT: 0px">  <DIV 
    style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
    <A title=ceo@triplebit.com 
    href="mailto:ceo@triplebit.com">ceo@triplebit.com</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> Friday, October 17, 2008 1:35 
    AM</DIV>
    <DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] Different 
    results of pcap_findalldevs_ex</DIV>
    <DIV><BR></DIV>
    <DIV><FONT size=2>Hi all,</FONT></DIV>
    <DIV><FONT size=2>Since no one answered my quetstion I'll do it 
    again...</FONT><BR></DIV>
    <DIV><FONT size=2>I use <FONT size=2><STRONG>pcap_findalldevs_ex 
    </STRONG>from Dot Net application with Interoperability. I use it in 
    different cases-</FONT></FONT></DIV>
    <DIV><FONT size=2>1. In one case I use it from a Winform which is the main 
    thread object and I get 3 network devices.</FONT></DIV>
    <DIV><FONT size=2>2. In a second case I use it from a WorkerThread and I get 
    only 2 network devices.</FONT></DIV>
    <DIV><FONT size=2>Is that normal and is there a way to eliminate the 
    difference?</FONT></DIV>
    <DIV><FONT size=2></FONT>&nbsp;</DIV>
    <DIV><FONT size=2>Regards</FONT></DIV>
    <DIV><FONT size=2>I. lesher</FONT></DIV>
    <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></BLOCKQUOTE></BODY></HTML>




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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic