I am doing a project where I must craft custom packets. That is, I have to have control of each packet header. I am trying to do this using sockets. Basically, what I need to do is this:
SOCKET s = socket(PF_UNSPEC, SOCK_RAW, ethernet_type);
The ethernet_type is something that is customized, non-standard, like 0xAAAA. I am using htons(). Also, it is very preferable for me not to use winPcap.
Right now, I am getting error 10043, protocol not supported.
The error message seems to suggest that I can configure the protocol into my system, but I have no idea how to do that.
It says:
Protocol not supported. The requested protocol has not been configured into the system, or no implementation for it exists. For example, a socket call requests a SOCK_DGRAM socket, but specifies a stream protocol.
There are a few different issues here, so if anyone has any input at all I'd really appreciate it.