Hi guys,
I've been recently playing around with IPv6 raw sockets using
PF_PACKET/SOCK_RAW and PF_PACKET/SOCK_DGRAM and I decided to put some
examples of successful routines on my webpage.
These examples all focus on sending packets, although one receives
neighbor advertisements.
Examples include: full ethernet frames, "cooked packet" ethernet
frames, IPv4 HDRINCL cases, and 6to4 cases. I give a neighbor solicit
sender, a neighbor advertisement sender, and a neighbor advertisement
receiver.
I also included a couple of examples of using ancillary data
structures to change properties of packets as well.
I found that I learn how to do these best when looking at examples, so
maybe these examples might be helpful to someone else. If nothing
else, I can refer to my own example repository.
I threw in IPv4 examples as well for completeness.
http://www.pdbuchan.com/rawsock/rawsock.html
Hopefully there isn't too many bugs. I tested all routines on Ubuntu
Lucid Lynx, compiling with GCC.
Dave