Networking Forums

Networking Forums > Computer Networking > Linux Networking > Some C language examples of linux raw sockets for IPv4 and IPv6

Reply
Thread Tools Display Modes

Some C language examples of linux raw sockets for IPv4 and IPv6

 
 
pdbuchan@yahoo.com
Guest
Posts: n/a

 
      12-17-2011, 03:30 AM
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPv6 address not connecting but IPv4-mapped -IPv6 does. Please help. DanielJohnson Network Routers 0 01-07-2009 12:10 AM
IPv6 and IPv4 conversion with Linux Router. RedPenguin Linux Networking 4 03-27-2007 01:52 PM
Using IPv4 TCPMSS target with IPv6-in-IPv4 Mark T.B. Carroll Linux Networking 1 03-18-2007 10:30 AM
IPv6 to IPv4 tjm Windows Networking 0 03-23-2006 07:53 PM
IPv4 --> IPv6 Anthony T. Wilson Linux Networking 2 12-20-2003 08:23 PM



1 2 3 4 5 6 7 8 9 10 11