geoip2_c 0.3.2 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ubuntu.yml +33 -0
- data/.github/workflows/windows.yml +52 -0
- data/README.md +22 -10
- data/docker-compose.yml +22 -1
- data/dockerfiles/{Dockerfile-ruby2.3 → Dockerfile-ruby2.5} +1 -1
- data/dockerfiles/{Dockerfile-ruby2.1 → Dockerfile-ruby2.6} +1 -1
- data/dockerfiles/{Dockerfile-ruby2.2 → Dockerfile-ruby2.7} +1 -1
- data/ext/geoip2/extconf.rb +11 -4
- data/ext/geoip2/geoip2.c +63 -18
- data/ext/geoip2/libmaxminddb/.gitignore +3 -0
- data/ext/geoip2/libmaxminddb/.travis.yml +24 -2
- data/ext/geoip2/libmaxminddb/Changes.md +39 -0
- data/ext/geoip2/libmaxminddb/README.dev.md +41 -30
- data/ext/geoip2/libmaxminddb/README.md +3 -3
- data/ext/geoip2/libmaxminddb/bin/Makefile.am +5 -0
- data/ext/geoip2/libmaxminddb/bin/mmdblookup.c +333 -15
- data/ext/geoip2/libmaxminddb/configure.ac +5 -5
- data/ext/geoip2/libmaxminddb/dev-bin/ppa-release.sh +8 -5
- data/ext/geoip2/libmaxminddb/dev-bin/release.sh +7 -0
- data/ext/geoip2/libmaxminddb/dev-bin/valgrind-all.pl +10 -3
- data/ext/geoip2/libmaxminddb/include/maxminddb.h +11 -2
- data/ext/geoip2/libmaxminddb/projects/VS12/libmaxminddb.vcxproj +3 -1
- data/ext/geoip2/libmaxminddb/projects/VS12/libmaxminddb.vcxproj.filters +7 -1
- data/ext/geoip2/libmaxminddb/src/Makefile.am +18 -2
- data/ext/geoip2/libmaxminddb/src/data-pool.c +180 -0
- data/ext/geoip2/libmaxminddb/src/data-pool.h +52 -0
- data/ext/geoip2/libmaxminddb/src/maxminddb.c +58 -48
- data/ext/geoip2/libmaxminddb/t/Makefile.am +6 -2
- data/ext/geoip2/libmaxminddb/t/bad_databases_t.c +1 -0
- data/ext/geoip2/libmaxminddb/t/basic_lookup_t.c +35 -0
- data/ext/geoip2/libmaxminddb/t/data-pool-t.c +374 -0
- data/ext/geoip2/libmaxminddb/t/external_symbols_t.pl +106 -0
- data/ext/geoip2/libmaxminddb/t/libtap/.gitignore +13 -0
- data/ext/geoip2/libmaxminddb/t/libtap/.travis.yml +13 -0
- data/ext/geoip2/libmaxminddb/t/libtap/COPYING +165 -0
- data/ext/geoip2/libmaxminddb/t/libtap/INSTALL +41 -0
- data/ext/geoip2/libmaxminddb/t/libtap/Makefile +72 -0
- data/ext/geoip2/libmaxminddb/t/libtap/Makefile.win +37 -0
- data/ext/geoip2/libmaxminddb/t/libtap/README.md +268 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/cmp_mem.c +20 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/cmp_mem.expected +28 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/cmpok.c +16 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/cmpok.expected +37 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/diag.c +10 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/diag.expected +2 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/diesok.c +14 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/diesok.expected +6 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/is.c +24 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/is.expected +58 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/like.c +10 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/like.expected +4 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/simple.c +31 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/simple.expected +32 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/skip.c +23 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/skip.expected +9 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/synopsis.c +13 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/synopsis.expected +9 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/test.c +28 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/todo.c +17 -0
- data/ext/geoip2/libmaxminddb/t/libtap/t/todo.expected +11 -0
- data/ext/geoip2/libmaxminddb/t/libtap/tap.c +354 -0
- data/ext/geoip2/libmaxminddb/t/libtap/tap.h +115 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/.gitattributes +1 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/.gitconfig +2 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/.gitignore +2 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/.perltidyallrc +11 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/.tidyallrc +7 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/LICENSE +4 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/MaxMind-DB-spec.md +558 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/README.md +4 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/README.md +7 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/libmaxminddb/libmaxminddb-offset-integer-overflow.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/maxminddb-golang/cyclic-data-structure.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/maxminddb-golang/invalid-bytes-length.mmdb +1 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/maxminddb-golang/invalid-data-record-offset.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/maxminddb-golang/invalid-map-key-length.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/maxminddb-golang/invalid-string-length.mmdb +1 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/maxminddb-golang/metadata-is-an-uint128.mmdb +1 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/bad-data/maxminddb-golang/unexpected-bytes.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/perltidyrc +12 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-Anonymous-IP-Test.json +32 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-City-Test.json +12616 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-Connection-Type-Test.json +102 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-Country-Test.json +10975 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-DensityIncome-Test.json +14 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-Domain-Test.json +452 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-Enterprise-Test.json +666 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-ISP-Test.json +12585 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoIP2-Precision-Enterprise-Test.json +1035 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/GeoLite2-ASN-Test.json +37 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/source-data/README +13 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-City-Test-Invalid-Node-Count.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-City-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-Country-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-Domain-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-ISP-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-Precision-Enterprise-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoLite2-ASN-Test.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-broken-pointers-24.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-nested.mmdb +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/README.md +26 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/maps-with-pointers.raw +0 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/write-test-data.pl +614 -0
- data/ext/geoip2/libmaxminddb/t/maxmind-db/tidyall.ini +5 -0
- data/geoip2_c.gemspec +2 -3
- data/lib/geoip2/database.rb +4 -0
- data/lib/geoip2/version.rb +1 -1
- metadata +114 -22
- data/.travis.yml +0 -31
- data/Appraisals +0 -7
- data/gemfiles/ruby_2.1.gemfile +0 -7
- data/gemfiles/ruby_2.2.gemfile +0 -7
@@ -0,0 +1,37 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"::1.128.0.0/107" : {
|
4
|
+
"autonomous_system_number" : 1221,
|
5
|
+
"autonomous_system_organization" : "Telstra Pty Ltd"
|
6
|
+
}
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"::12.81.92.0/118" : {
|
10
|
+
"autonomous_system_number" : 7018,
|
11
|
+
"autonomous_system_organization" : "AT&T Services"
|
12
|
+
}
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"::12.81.96.0/115" : {
|
16
|
+
"autonomous_system_number" : 7018
|
17
|
+
}
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"2600:6000::/20" : {
|
21
|
+
"autonomous_system_number" : 237,
|
22
|
+
"autonomous_system_organization" : "Merit Network Inc."
|
23
|
+
}
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"2600:7000::/24" : {
|
27
|
+
"autonomous_system_number" : 6939,
|
28
|
+
"autonomous_system_organization" : "Hurricane Electric, Inc."
|
29
|
+
}
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"2600:7100::/24" : {
|
33
|
+
"autonomous_system_number" : 237,
|
34
|
+
"autonomous_system_organization" : "Merit Network Inc."
|
35
|
+
}
|
36
|
+
}
|
37
|
+
]
|
@@ -0,0 +1,13 @@
|
|
1
|
+
All of these but the City and Enterprise files are JSON dumps of the databases
|
2
|
+
created by the GeoIP2 build integration tests
|
3
|
+
(TestFor::MM::Integration::GeoIP2::Build).
|
4
|
+
|
5
|
+
Additional data was added to match our legacy test databases.
|
6
|
+
|
7
|
+
The City file is of unknown origin.
|
8
|
+
|
9
|
+
The Enterprise file is a single example IP address, modified slightly to
|
10
|
+
include all fields.
|
11
|
+
|
12
|
+
The Precision files is the normal GeoIP2 files with an additional marker
|
13
|
+
(128.101.101.101) to differentiate the two.
|
data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/ext/geoip2/libmaxminddb/t/maxmind-db/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb
ADDED
Binary file
|
Binary file
|
@@ -0,0 +1,26 @@
|
|
1
|
+
The write-test-dbs script will create a small set of test databases with a
|
2
|
+
variety of data and record sizes (24, 28, & 32 bit).
|
3
|
+
|
4
|
+
These test databases are useful for testing code that reads MaxMind DB files.
|
5
|
+
|
6
|
+
There is also a `maps-with-pointers.raw` file. This contains the raw output of
|
7
|
+
the MaxMind::DB::Writer::Serializer module, when given a series of maps which
|
8
|
+
share some keys and values. It is used to test that decoder code can handle
|
9
|
+
pointers to map keys and values, as well as to the whole map.
|
10
|
+
|
11
|
+
There are several ways to figure out what IP addresses are actually in the
|
12
|
+
test databases. You can take a look at the
|
13
|
+
[souce-data directory](https://github.com/maxmind/MaxMind-DB/tree/master/source-data)
|
14
|
+
in this repository. This directory contains JSON files which are used to
|
15
|
+
generate many (but not all) of the database files.
|
16
|
+
|
17
|
+
You can also use the
|
18
|
+
[mmdb-dump-database script](https://github.com/maxmind/MaxMind-DB-Reader-perl/blob/master/eg/mmdb-dump-database)
|
19
|
+
in the
|
20
|
+
[MaxMind-DB-Reader-perl repository](https://github.com/maxmind/MaxMind-DB-Reader-perl).
|
21
|
+
|
22
|
+
Some databases are intentionally broken and cannot be dumped. You can look at
|
23
|
+
the
|
24
|
+
[script which generates these databases](https://github.com/maxmind/MaxMind-DB/blob/master/test-data/write-test-data.pl)
|
25
|
+
to see what IP addresses they include, which will be necessary for those
|
26
|
+
databases which cannot be dumped because they contain intentional errors.
|