the-tcpdump-group / libpcap

the LIBpcap interface to various kernel packet capture mechanism
https://www.tcpdump.org/
Other
2.72k stars 854 forks source link

WinPcap fails on AppVeyor #923

Closed gvanem closed 3 years ago

gvanem commented 4 years ago

As a test of installing WinPcap on AppVeyor (which I need in another project), I fail to get any libpcap program to work on AppVeyor; the program just hangs.

Basically I did:

I'm not sure who's fault it is. Maybe AppVeyor doesn't allow npf.sys or it's service to run? Or maybe the cinst winpcap isn't done properly.

mcr commented 4 years ago

(I hate how distracting the number of warnings coming out that build is)

echo Trying to run 'run\rpcapd.exe' with the above 'winpcap' installation
Trying to run 'run\rpcapd.exe' with the above 'winpcap' installation
run\rpcapd.exe

AFAIK, rpcapd.exe would attempt to open the capture device, and I can't see how you'd permission to do that on AppVeyor. I don't think that's a good way to test the library, alas.

gvanem commented 4 years ago

(I hate how distracting the number of warnings coming out that build is)

MinGW is a bitch when it comes to printf-warnings.

and I can't see how you'd permission to do that on AppVeyor. I don't think that's a good way to test the library, alas.

I've heard NPcap has a silent installer. Maybe that would work better? A real pity otherwise.

fxlb commented 4 years ago

Only with Npcap OEM? "Silent installer—Npcap OEM includes a silent installation option (/S)" https://nmap.org/npcap/oem/redist.html

gvanem commented 4 years ago

There is a fork of this NMAP silent installer here: https://github.com/mfontanini/winpcap-installer

Besides PcapPlusplus seems to use WinPcap on Appveyor. I'll check it out.

pavel-kirienko commented 3 years ago

I seem to be facing a similar issue where my application that leverages WinPCap operates correctly in my local virtual machine with Windows 10 (managed by VirtualBox), but fails to capture any packets when run in an AppVeyor Windows pipeline. My setup is otherwise functional: the very same application functions correctly when run in a GNU/Linux pipeline using libpcap (also on AppVeyor). I am capturing packets from all interfaces so it is not likely that I chose the wrong interface.

@gvanem have you been able to resolve this issue?

gvanem commented 3 years ago

have you been able to resolve this issue?

No.

mcr commented 3 years ago

It is very unlikely that the AppVeyor system gives you permission to capture packets.

infrastation commented 3 years ago

It looks like this effect is a peculiarity of Appveyor, in which case this issue is not actionable and the best next stop would be Appveyor tech support. Maybe some different Windows CI service works better in this regard (Cirrus CI is not difficult to figure out, for example). If anyone can tell the reason to keep this issue open, please do. Otherwise it will be closed in 7 days.

pavel-kirienko commented 3 years ago

I actually managed to get it to work with AppVeyor, although I am now using Npcap. WFIW, here is my recipe:

https://github.com/UAVCAN/pyuavcan/blob/9da3cf579b65cae4067b16c621cc3321156f17d4/.appveyor.yml#L46-L52

gvanem commented 3 years ago

@pavel-kirienko This looks pretty cool. I'll try the shutdown .. command.

infrastation commented 3 years ago

It is time.