dotpcap / packetnet

Official repository - High performance .Net assembly for dissecting and constructing network packets such as ethernet, ip, tcp, udp etc.
Mozilla Public License 2.0
474 stars 105 forks source link

Problem with .Net Core package, Ubuntu 14.04 #53

Closed Pedestrian22 closed 5 years ago

Pedestrian22 commented 6 years ago

I would like to ask you if somebody knows how to help with this problem. I cannot run my project in Ubuntu 14.04. There is missed package "PacketDotNet" and I need to run it in .Net Core project. Thanks for any idea and help.

screen1

chmorgan commented 6 years ago

Hello!

Have you put a sharppcap.dll.config in place that maps wpcap to libpcap? You'll want to do that and ensure that the libpcap name matches on that exists on your system, sometimes its libpcap.so, othertimes libpcap.so.0.19 or whatever. I haven't found a solid way to do that across debian/ubuntu and fedora as one has a symlink to the shorter name and the other doesn't.

On Fri, Mar 23, 2018 at 4:54 AM, Pedestrian22 notifications@github.com wrote:

I would like to ask you if somebody knows how to help with this problem. I cannot run my project in Ubuntu 14.04. There is missed package " PacketDotNet" and I need to run it in .Net Core project. Thanks for any idea and help.

[image: screen1] https://user-images.githubusercontent.com/37690531/37820157-17da39fa-2e80-11e8-8407-e36a81e23a2a.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chmorgan/packetnet/issues/53, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJ-AFZd1NGpIL2_hJgUvTgmPnvWh-o1ks5thLhYgaJpZM4S4Xaj .

Pedestrian22 commented 6 years ago

So, after this action, should it work? I mean, is it even possible to run .Net Core with PacketDotNet/SharpPcap on Ubuntu 14.04?

chmorgan commented 6 years ago

I’m not sure on 14.04 but I’ve installed dotnet from Microsoft on fedora 27 and run .net core apps there.

On Sat, Mar 24, 2018 at 5:31 PM Pedestrian22 notifications@github.com wrote:

So, after this action, should it work? I mean, is it even possible to run .Net Core with PacketDotNet/SharpPcap on Ubuntu 14.04?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/chmorgan/packetnet/issues/53#issuecomment-375926307, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJ-APurWND9PiaJWNNLJd_75POFz8Xaks5thrsZgaJpZM4S4Xaj .

chmorgan commented 6 years ago

Hi @Pedestrian22.

I've updated packetdotnet to build against .net standard 2.0. I think you'll still see an issue unless you run under mono due to the necessary library mapping. I'm looking to make it more compatible with dotnet but it would require runtime library loading and mapping and I'm not sure what the performance impact is of that approach or how much work it could be.

nono3551 commented 5 years ago

Hi,

I am working on small packet sniffer for Linux and Windows. I didn't tested anything on Windows yet. I hope it won't be such painful for me as Linux. For Linux (Ubuntu 18.04) I made this package work in two ways:

I installed libpcap with apt-get install libpcap-dev.

  1. I created .NET Framework 4.6.1 project. Added SharpPcap.dll.config file for mapping wpcap <= libpcap. Run MyProject.exe with mono. Everything is working.

  2. I created .NET Core 2.1 project. Copied libpcap.so => wpcap.so. Run project with 'dotnet run' command. Everything is working.

In both approaches everything seems to be working fine but something doesn't feel right about their background.

I new in this kind of issues. Could you please help me to chose between those two or help me find some other way to make package working on both Linux and Windows?

Thank you

chmorgan commented 5 years ago

Hi @nono3551. Please check out the latest sharppcap release. It has much better cross platform support that doesn't require monkeying around with libraries.

nono3551 commented 5 years ago

Hi @chmorgan. I just checked it out and everything seems to be working fine. Thank you very much.