This article is part of the series Making our own ping:
- A short (and mostly wrong) history of computer networking
- Windows dynamic libraries, calling conventions, and transmute
- FFI-safe types in Rust, newtypes, MaybeUninit, and references vs pointers
- Designing and implementing a safer API on top of LoadLibrary
- A simple ping library, parsing strings into IPv4 address
- The builder pattern, and a macro that keeps FFI code DRY
- Down, down, down the stack
- Variable-length everything
- Consuming Ethernet with nom
Okay, I lied.
I’m deciding - right this instant - that using wmic is cheating too. Oh, it was fair game when we were learning about Windows, but we’re past that now.
We know there’s IPv4 routing tables, and we know network interfaces have indices (yes, they do change when you disable/enable one, so ill-timed configuration changes may make our program blow up).
Want to read more?
This post is Patreon-exclusive until November 22, 2019
Become a Patron now to get early access to all my posts. Learn more