[prev in list] [next in list] [prev in thread] [next in thread]
List: winpcap-users
Subject: [Winpcap-users] Problem with PCAP_OPENFLAG_NOCAPTURE_LOCAL on
From: "Larry Leo" <leo0888 () gmail ! com>
Date: 2007-09-10 22:13:54
Message-ID: 7cb2728f0709101513x303617c8vea4a6c72c8740454 () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi all,
I am having problem using pcap_open() with PCAP_OPENFLAG_NOCAPTURE_LOCAL on
windows 2000. I modified basic_dump.c with code from sendpack.c to send
100 bytes to the selected network adapter, but used pcap_open() (from
userlevelbridge) instead of pcap_open_live(). I resulted exe works on win
xp but not on win 2000. I compiled on cygwin and verified using ethereal to
capture the packet. The pcap_open code from userlevelbridge is:
if((adhandle = pcap_open(d->name, // name of the device
65536, // portion of the packet to capture.
// 65536 grants that the whole packet will be captured
on every link layer.
PCAP_OPENFLAG_PROMISCUOUS | // flags. We specify that we
don't want to capture loopback packets, and that the driver should deliver
us the packets as fast as possible
PCAP_OPENFLAG_NOCAPTURE_LOCAL |
PCAP_OPENFLAG_MAX_RESPONSIVENESS,
500, // read timeout
NULL, // remote authentication
errbuf // error buffer
)) == NULL)
{
fprintf(stderr,"\nUnable to open the adapter. %s is not supported by
WinPcap\n", d->name);
/* Free the device list */
pcap_freealldevs(alldevs);
return -1;
}
If I commented out the PCAP_OPENFLAG_NOCAPTURE_LOCAL flag, then it would
work on both win XP and 2000 platforms, but the packet is looped back.
Any help to make the PCAP_OPENFLAG_NOCAPTURE_LOCAL flag work on win 2000
would be appreciated.
Regards,
Larry
[Attachment #5 (text/html)]
Hi all,<br><br>I am having problem using pcap_open() with \
PCAP_OPENFLAG_NOCAPTURE_LOCAL on windows 2000. I modified basic_dump.c \
with code from sendpack.c to send 100 bytes to the selected network adapter, but used \
pcap_open() (from userlevelbridge) instead of pcap_open_live(). I resulted exe \
works on win xp but not on win 2000. I compiled on cygwin and verified using ethereal \
to capture the packet. The pcap_open code from userlevelbridge is: \
<br><br>if((adhandle = pcap_open(d->name, // name of the \
device<br> \
65536, // portion of the packet to \
capture. <br> \
// 65536 grants that the whole packet will be \
captured on every link layer. <br> \
PCAP_OPENFLAG_PROMISCUOUS | // flags. We \
specify that we don't want to capture loopback packets, and that the driver \
should deliver us the packets as fast as possible<br> \
PCAP_OPENFLAG_NOCAPTURE_LOCAL | \
<br> \
PCAP_OPENFLAG_MAX_RESPONSIVENESS,<br> \
500, // read \
timeout<br> \
NULL, // remote \
authentication<br> \
errbuf // error \
buffer<br> )) == NULL) \
<br>{<br> fprintf(stderr,"\nUnable to open the adapter. %s is \
not supported by WinPcap\n", d->name);<br> /* Free the \
device list */<br> pcap_freealldevs(alldevs);<br> \
return -1;<br>}<br><br>If I commented out the PCAP_OPENFLAG_NOCAPTURE_LOCAL flag, \
then it would work on both win XP and 2000 platforms, but the packet is looped back. \
<br><br>Any help to make the PCAP_OPENFLAG_NOCAPTURE_LOCAL flag work on win 2000 \
would be appreciated.<br><br>Regards,<br><br>Larry<br>
_______________________________________________
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