-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PcapLiveDeviceList::getPcapLiveDevicesList() empty vector / error #1176
Comments
The exception seems to be inside of WinPcap and not in PcapPlusPlus source code, so it's hard to know what's the issue... Do you see this interface when using Wireshark or tcpdump? |
Yes, I do see the interface when using Wireshark. |
For what its worth, I am running into the same issue, also installed via vcpkg. haven't tried using winpcap yet. Also, same code I am using works when using the precompiled example project. Tried compiling everything in msvc 142 to match the example project, but getting a unresolved external symbol __std__find_trivial_1 while linking |
@psZachary @ganeshharihara I'm not sure the latest release (v22.11) that you installed via vcpkg works well in VS2022, maybe that's the problem? One thing that you can do is build from source. We recently moved to CMake so buidling from |
hi @seladb I tried building via instructions you passed and linking and getting the same error. Any thoughts? EDIT: Actually got it to work, but trying to figure out how to compile with ztsd support. Doesnt seem to be an option in the config setup for windows |
@ganeshharihara @psZachary I did some research and it seems to be something with the interface name or description. Maybe the interface description is empty or has some non-standard characters? Can you please run |
@psZachary @ganeshharihara I downloaded WinPcap source code and tried to follow the stack trace again. I still think that @psZachary from your example it seems the interface name and desc are ok and don't contain any non-standard characters. So maybe there is a permission issue reading the data using |
@psZachary @ganeshharihara any update on this? |
I am closing this issue because I haven't gotten a response yet. If anyone stumbles upon this issue and can help debug it, I'd really appreciate it! |
I get the same issue! With WinPcap it produced the same exception as previously posted in this thread, with Npcap installed PCPP installed via Vcpkg on Windows 23H2, Visual Studio 2022, Npcap 1.79. |
Thanks @gardc ! Since I can't reproduce the issue locally, I'll be very happy if you can help debug it on your system. I provided some insights in these comments: #1176 (comment), #1176 (comment) |
I can do what I can to help! Here is my
netsh:
Since you previously mentioned special characters in device names, I noticed the character Also, I've tested with Go and using the gopacket/pcap library it's able to list devices using the same Npcap which PCPP is using: devices, err := pcap.FindAllDevs()
if err != nil {
panic(err)
}
for _, device := range devices {
fmt.Println("Name: ", device.Name)
fmt.Println("Description: ", device.Description)
for _, address := range device.Addresses {
fmt.Println("- IP address: ", address.IP)
fmt.Println("- Subnet mask: ", address.Netmask)
}
} |
Thank you @gardc for the info! Can you look at your stack trace? Does it fail in the same place mentioned here #1176 (comment)? If you can gather any information about the values passed to any of the methods in the stack trace, that'd be helpful. Or if you find a way to reproduce it on any Windows machine, that'd be even more helpful |
Hello @seladb, i got same issue. |
Thank you @nvcuong1312 , this is very helpful! I downloaded WinPcap source code and tracked the code according to the call stack you shared. Apparently In the stack trace you shared I can't see the full name (it's cut), can you shared the full name? We can try to write code that does the same |
@seladb Ok! Please wait
|
@nvcuong1312 can you provide the interface full name? It's the one that starts with |
@seladb Please check: |
I checked |
Currently running into the same issue, pcpp installed via vcpkg. Is there any way I can help? EDIT: tried with conan and pcpp 23.09 and it works. |
I think there is an issue with WinPcap which I can't identify, so I recommend switching to Npcap which is still maintained (WinPcap is abandoned). |
Yes, I do want to note that I recently used this project again for another project, it worked on the same PC Could be issues with the underlying Windows system calls. I would recommend trying to:
It's not the ideal solution but it seems to be what worked for me. |
Hi guys, Im building using clion and MSVC and have noticed that during the build process packet.dll and wpcap.dll are being copied from the vcpkg installed directory to the output directory. Since the pcap should use the dlls from the npcap instalation this does not work. I have resolved this issue simply by deleting the dlls from the output directory |
@tinCheq I'm sorry for the late response. Which version of PcapPlusPlus are you using? |
Hello, had a few issues with the live device list returning 0.
I've tried a few solutions discussed in a couple other closed issues to no avail.
Output:
size is: 0
But I have installing npcap and winpcap (npcap before winpcap) and nothing worked, size is always 0.
When I type ipconfig, this is what is returned:
So clearly there is a network device on the computer.
I am running Windows 10 Pro 22h2, using vcpkg and Visual Studio 2022.
Current Status:
npcap: getPcapLiveDevicesList() empty
winpcap: Causes crashes
The text was updated successfully, but these errors were encountered: