On linux there's AF_PACKET for layer two sockets (it has a different name for BSD/OS X). There are others too which I don't know anything about. I didn't know how best to approach this, so I left it open ended (you can create anything you could create with socket() in the current form).

You are correct, all the sockaddr stuff becomes irrelevant when you're not working with protocols using ipv4/6.