Michael Tremer wrote:
Would you be willing to tidy up your code (if required) and submit them on here so that we can officially support Windows?
I've put a preliminary version of my patched 'libloc' in my 'Wsock-trace' project: https://github.com/gvanem/wsock-trace/tree/master/src/Geo-IP/IPFire/libloc/s...
Running all the 'test-*' programs, it worked seemingly well. Until I built the Python3 module and played with e.g. 'location dump' and 'verify'. Nothing worked :-(
What didn’t work specifically? Reading and writing the database?
'test-database' says: Vendor doesn't match: LOCDBXX☺ != Test Vendor and 'test-network': Could not look up 2001:db8::
I'm not sure it due to my 'mmap()' function. But I noted a case where 'loc_stringpool_get()' could return NULL, this is used in 'strdup()'. Not sure that's legal everywhere. So I did this patch:
--- a/libloc/src/as.c 2020-10-19 17:35:01 +++ b/libloc/src/as.c 2020-10-20 19:37:19 @@ -90,7 +90,7 @@ }
LOC_EXPORT int loc_as_set_name(struct loc_as* as, const char* name) { - as->name = strdup(name); + as->name = name ? strdup(name) : strdup("");
return 0; }
What you will need to import the raw data is location-importer which comes with libloc and a PostgreSQL server.
No! I hoped that 'libloc' would be similar to IP2Location and/or GeoipCSV that I already support in my project. Running PostgreSQL is out of the question for me or any users of 'Wsock-trace'.
Generating the whole database might take a couple of hours depending on how beefy your machine is.
Lacking in Python skills, I cooked up this 'compile-database' script that takes 2 minutes: https://github.com/gvanem/wsock-trace/blob/master/src/Geo-IP/IPFire/database...
But it remains to see if it works. Or if I'll rewrite it into a C-program.