On Mon Oct 10 13:42:54 2022 +0000, Jinoh Kang wrote:
We should declare separate structs for Unix pcap and Win32 (w)pcap instead.
I had an original version to fix this that moved all the build_win32_device logic and helper functions to its own unixlib file, where you have access to the host pcap structs and the Win32 ones. This has the advantage of not indiscriminately casting everything from host libpcap to Win32 structs and resulted in functions like
`static SOCKADDR *dup_sockaddr( const struct sockaddr *addr )`
or
`static struct pcap_interface *build_win32_device( const pcap_if_t *unix_dev, const char *source, const char *adapter_name )`
Was a bit ugly though since SOCKET (and something else which I can’t remember right now) had to be undefined (even with the WS prefix) and it was a rather large change in the end, which seemed unnecessary when Unix and Win32 structs seemed to happily align except for the sockaddr, so I tried to come up with something smarter, which was not the best idea…