i was palying with the ruby sockets, so i ended up trying to put an IP packet togather, then i took an ip packet and try to make a new one just like it.
now my problem is: if the packet is: 45 00 00 54 00 00 40 00 40 01 06 e0 7f 00 00 01 7f 00 00 01
, and this is obviously hexadecimal, so i converted it into a decimal, then into a binary data using the .pack method, and pass it up to the send method, then the Wireshark
shows me a very strange different thing from what i created, i doing something wrong ???, i know that, but can t figure it out:
@packet = 0x4500005400004000400106e07f0000017f000001 #i converted each 32 bits together, not like i wrote
@data = ""
@data << @packet.to_s
@socket.send(@data.unpack(c*).to_s,@address)
and is there another way to solve the whole thing up, can i for example write directly to the socket buffer the data i want to send??
thanks in advance.