Right, so. I wanted to learn to use Raw Sockets so I could make a class for them, yes? Well, I've hit a snag with using IP_HDRINCL with getsockopt();
By default, Raw Sockets automatically build an IP header for you, by declaring IP_HDRINCL on a handle to a raw socket descriptor, you have to make the headers for the packets that are sent through it.
This proves to be easier than I thought it would be and rather linear in reality, there is a problem however:
http://rafb.net/paste/results/0DVWSz56.html
That code shows me error code 10022 on line 118, I looked up the error code and it is caused by an invalid parameter on line 115 AKA setsockopt(); MSDN has told me it normally has something to do with the level parameter (param 2) of setsockopt. I checked at least 5 times, I am using IPPROTO_IP, which is valid, in conjunction with IP_HDRINCL which is also valid as stated by MSDN (certain levels used in setsockopt can only set certain options on the socket, both IPPROTO_IP and IPPROTO_IPV6 can use IP_HDRINCL.)
Can anybody here help?