This isn't an embedded application, but I approached it with embedded sensibilities.

I wanted a simple tool to translate IPv4 addresses into country names, and couldn't find it.

There is a Creative Commons Licensed database available from Maxmind, but the .mmdb database API seems so unnecessarily complicated.

Thankfully, Maxmind also now provides a CSV format version of the data. As-is, it is still not straightforward to use, but the raw data is there.

I wrote some code to translate the Maxmind CSV Country data into a straightforward const C array, and some more code to leverage this straightforward const C array.

My entire search routine is only about 20 lines of codes (versus reams and reams of MMDB database routines from Maxmind). The entire application (with database built-in) is only 50-55% of the size of the Maxmind MMDB file.

My source code is available to download here. Place the uncompressed Maxmind CSV files in the same directory and "make".


back to main page contact