pbiering/ipv6calc

DBIP Source and DBIP-Generate.pl

n1tr0 opened this issue · 6 comments

n1tr0 commented

The current DBIP source only implements the free databases, as well as the DBIP-Generate.pl script. Is it possible to get them working with the full version from DBIP to improve the output?

I wanted to contact you about looking into the changes since any modifications would be something you could do faster then others being the author of the code.

Unfortunatly I have no "full version" from DBIP but I assume the data is also delivered via gzip compressed csv.

So it would be more a missing support in DBIP-update.sh for an authenticated download of the files.

If you have access to "full version" you can simply try to generate the db file using the DBIP-generate-db.pl.

n1tr0 commented

Thank you for getting back to me in the this issue. I have tried this method and the generate.pl script looks for city or country expecting the free versions and then parses them to create the Berkley DB files for both ipv4 and ipv6. I also noticed that even if I were to write my own parser to generate the ipv4 and ipv6 databases from the full version I would not have the changes reflected in the c++ code written for the dbip-wrapper c/h files.

Can I send you a few segments of the "full version" to understand the fields that are required for input and parsing?

Thanks

From that what you are writing it looks like that commercial DBIP files contain more data (according to what I can retrieve from their homepage also the ISP) then the free version. Yes, please send the first lines of IPv4 and IPv6 to my private e-mail address and I will analyze and extend parser and code.

n1tr0 commented

I am putting that together for you now. I will have a few other sections I noticed you could include.

Thank you

Support for DB-IP.com's "full" (aka "IP to Location+ISP") database added, missing is "IP to ISP" and "IP to Location" (perhaps one can also provide me some sample lines and filename).

$ ./ipv6calc/ipv6calc --db-dbip-dir .. -vv
...
db-ip.com: features available/implemented: 0x03003fc0/0x03003fc0 (100%)
DBIP: info of available databases in directory: ..
DBIP: IPv4 CountryCode              : ipv6calc-dbip-ipv4-country.db  (DBIP-1/20161001, created: 20161009-090609 UTC)
DBIP: IPv6 CountryCode              : ipv6calc-dbip-ipv6-country.db  (DBIP-2/20161001, created: 20161009-090609 UTC)
DBIP: IPv4 City/Region/CountryCode  : ipv6calc-dbip-ipv4-city.db     (DBIP-3/20161001, created: 20161009-090650 UTC)
DBIP: IPv6 City/Region/CountryCode  : ipv6calc-dbip-ipv6-city.db     (DBIP-4/20161001, created: 20161009-090650 UTC)
DBIP: IPv4 Location/ISP             : ipv6calc-dbip-ipv4-full.db     (DBIP-9/20170201, created: 20170219-160353 UTC)
DBIP: IPv6 Location/ISP             : ipv6calc-dbip-ipv6-full.db     (DBIP-10/20170201, created: 20170219-160353 UTC)
DBIP: detected best databases FREE    Country4=3    Country6=4    City4=3    City6=4  
DBIP: detected best databases COMM    Country4=9    Country6=10   City4=9    City6=10 
DBIP: selected best databases normal  Country4=9    Country6=10   City4=9    City6=10 
DBIP: selected best databases method: COMM older than 12 months are deselected in case of FREE is available
DBIP: selected best databases method: COMM/FREE with more features are only selected in case not older than 1 months of already found COMM/FREE
...

and here an example:

$ ./ipv6calc/ipv6calc --db-dbip-dir .. -m -i 2c0f:ffe8::1 -q
IPV6=2c0f:ffe8:0000:0000:0000:0000:0000:0001
...
DBIP_COUNTRY_SHORT=NG
DBIP_CITY=Dunde
DBIP_REGION=Sokoto
DBIP_DATABASE_INFO=DBIP-10/20170201, created: 20170219-160353 UTC
...
IPV6CALC_NAME=ipv6calc
IPV6CALC_VERSION=0.99.3
...

"print-all" from available DB-IP.com (like as for IP2Location) will be implemented next.

Implementation finished in 0.99.3.rc1 (current "master")