meh / rust-packet

Network packet handling for Rust.
90 stars 27 forks source link

How do I send a packet? #4

Open ivandardi opened 6 years ago

ivandardi commented 6 years ago

I created a packet. Now how do I actually send it over the network?

meh commented 6 years ago

Over the network through what though?

You could be using a tun or tap interface, or something like netmap, or through a network device already in use?

ivandardi commented 6 years ago

Like, let's say I build an IPv4 packet. I wish to send it to another address. How would I do that? Do I have to turn it into bytes and send it over a std::net::TcpStream or something like that?

meh commented 6 years ago

You need a raw socket in that case.