Earlier this week, I posted the code for a tool I wrote many years ago:
In 2001, I wrote DHCPLite to unblock development scenarios between Windows and prototype hardware we were developing on. I came up with the simplest DHCP implementation possible and took all the shortcuts I could - but it was enough to get the job done! Since then, I've heard from other teams using DHCPLite for scenarios of their own. And recently, I was asked by some IoT devs to share DHCPLite with that community. So I dug up the code, cleaned it up a bit, got it compiling with the latest toolset, and am sharing the result here.
If that sounds interesting, please visit the DHCPLite project page on GitHub.
- Other than a couple of assumptions that changed in the last 15 years (ex: interface order), the original code worked pretty much as-is.
- Now that the CRT has sensible string functions, I was able to replace my custom
strncpyzhelper with strncpy_s and _TRUNCATE.
- Now that the IP Helper API is broadly available, I was able to statically link to it instead of loading dynamically via classes
- Now that support for the STL is commonplace, I was able to replace the custom
GrowableThingCollectionimplementation with std::vector.
- I used the "one true brace style" (editors note: hyperbole!) from Code Complete, but it never really caught on and the code now honors Visual Studio defaults.
Or at least thinking you have... :)