From: Joel VanderWerf Date: 2008-07-11T07:05:06+09:00 Subject: Re: Ruby Raw Sockets Filipe Manana wrote: > Hello, > > I am trying to do packet injection through a Ruby socket, like this: > > PF_PACKET = 17 # linux/socket.h > AF_PACKET = PF_PACKET # linux/socket.h > ETH_P_ALL = 0x03_00 # linux/if_ether.h (but in network byte order) > SIOCGIFINDEX = 0x89_33 # bits/ioctls.h Unsolicited suggestion: if you're doing a lot of packing, byte swapping, etc, take a look at my bit-struct lib for constructing packets[1]. There are even a couple of basic raw IP examples, though you seem to have gotten well beyond the basics. [1] http://raa.ruby-lang.org/project/bit-struct/ -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407