I am porting a communications library from Linux to Windows. I know what my approach is for the most part. The library uses all raw ethernet level frames for all the communications.
The library I am porting from makes use of the PF_PACKET family and the struct sockaddr_ll. After browsing through the MSDN winsock site, I haven't found an equivalent family/struct. What should my approach be here?
I have a few ideas, but I am not sure if they are good ideas I could use PF_UNSPEC, for unspecified. I could just pass the number PF_PACKET represents (it's an unsigned short) I could also just make my own sockadddr_ll struct in Windows.
None of those ideas seem good to me, they just seem like hacks that aren't really likely to work.
If anyone has any suggestions, I would appreciate it.
I assume you're referring to Raw Sockets (where you have to write the network layer, transport layer, and application layer information). New Windows versions (XP SP2 and up) have very limited support for raw sockets with many restrictions.
More info (scroll down to "Limitations on Raw Sockets")
The solution, I believe, is to use WinPcap, which allows you to send raw packets on those systems.