#icmp
8 articles tagged #icmp. All tags
Crafting ICMP-bearing IPv4 packets with the help of bitvec
So. Serializing IPv4 packets. Easy? Well, not exactly. IPv4 was annoying to parse, because we had 3-bit integers, and 13-bit integers, and who knows what else. Serializing it is going to be exactly…
35 min
Parsing and serializing ICMP packets with cookie-factory.
In the last part, we’ve finally parsed some IPv4 packets. We even found a way to filter only IPv4 packets that contain ICMP packets. There’s one thing we haven’t done though, and that’s verify their…
25 min
Parsing IPv4 packets, including numbers smaller than bytes
Hello and welcome to Part 11 of this series, wherein we finally use some of the code I prototyped way back when I was planning this series. Where are we standing? Let’s review the progress we’ve made…
21 min
Finding the default network interface through WMI
Let’s set aside our sup project for a while. Don’t get me wrong - it’s a perfectly fine project, and, were we simply rewriting “ping” for Windows in Rust, we could (almost) stop there. We’re…
15 min
The builder pattern, and a macro that keeps FFI code DRY
Our ping API is simple, but it’s also very limited: pub fn ping(dest: ipv4::Addr) -> Result<(), String>. // called as: ping(ipv4::Addr([8, 8, 8, 8])).unwrap(); It doesn’t allow specifying the TTL…
12 min
A simple ping library, parsing strings into IPv4 address
We’ve just spent a lot of time abstracting over LoadLibrary, but we still have all the gory details of the Win32 ICMP API straight in our main.rs file! That won’t do. This time will be much quicker…
13 min
FFI-safe types in Rust, newtypes and MaybeUninit
It’s time to make sup, our own take on ping, use the Win32 APIs to send an ICMP echo. Earlier we discovered that Windows’s ping.exe used IcmpSendEcho2Ex. But for our purposes, the simpler…
12 min
Windows dynamic libraries, calling conventions, and transmute
So, how does ping.exe actually send a ping? It seems unrealistic that ping.exe itself implements all the protocols involved in sending a ping. So it must be calling some sort of library. Also, since…
18 min