dotpcap / sharppcap

Official repository - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets
1.28k stars 267 forks source link

Consider replacing all Marshal.PtrToStructure with manual marshalling #409

Open Fabi opened 2 years ago

Fabi commented 2 years ago

Recently I worked on some apps with sharppcap and tested it with the reflection free mode in native aot. Currently it's incompatible due to the usage of Marshal.PtrToStructure. It should be considered to change all those usages to custom marshalling to have those things working at least in .NET 7 in reflection free mode.

Samples from a runtime change: https://github.com/dotnet/runtime/pull/70866/files