people/ms/libloc.git
3 months agotest-database: Remove signature checks master
Michael Tremer [Thu, 12 Dec 2019 13:34:21 +0000 (13:34 +0000)] 
test-database: Remove signature checks

These are performed in an extra test now

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agowriter: Erase the padding
Michael Tremer [Thu, 12 Dec 2019 13:18:51 +0000 (13:18 +0000)] 
writer: Erase the padding

We should not leak any data from the stack into the
database and this makes debugging easier, too.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoLog blocks that are being fed into the signature
Michael Tremer [Thu, 12 Dec 2019 13:13:31 +0000 (13:13 +0000)] 
Log blocks that are being fed into the signature

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agowriter: Put whole header into the hash instead of only the first 8 bytes
Michael Tremer [Thu, 12 Dec 2019 13:02:44 +0000 (13:02 +0000)] 
writer: Put whole header into the hash instead of only the first 8 bytes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agotest-signature: Fix path to key
Michael Tremer [Thu, 12 Dec 2019 12:52:41 +0000 (12:52 +0000)] 
test-signature: Fix path to key

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoLog the signature in debug mode
Michael Tremer [Thu, 12 Dec 2019 12:47:28 +0000 (12:47 +0000)] 
Log the signature in debug mode

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Catch any errors from EVP_DigestVerify_Update()
Michael Tremer [Thu, 12 Dec 2019 12:16:19 +0000 (12:16 +0000)] 
database: Catch any errors from EVP_DigestVerify_Update()

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agotest: Add test to check that invalid signatures do not validate
Michael Tremer [Thu, 12 Dec 2019 12:08:53 +0000 (12:08 +0000)] 
test: Add test to check that invalid signatures do not validate

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoperl: Add get_continent_code()
Stefan Schantl [Wed, 11 Dec 2019 10:38:14 +0000 (11:38 +0100)] 
perl: Add get_continent_code()

This function allows to get the continent code by a given country code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Correctly handle error codes from OpenSSL
Michael Tremer [Wed, 11 Dec 2019 11:21:05 +0000 (11:21 +0000)] 
database: Correctly handle error codes from OpenSSL

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-downloader: Add command to verify the downloaded database manually
Michael Tremer [Tue, 10 Dec 2019 18:53:21 +0000 (18:53 +0000)] 
location-downloader: Add command to verify the downloaded database manually

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoInstall databases to /var/lib/location
Michael Tremer [Tue, 10 Dec 2019 18:09:38 +0000 (18:09 +0000)] 
Install databases to /var/lib/location

This data is being modified and should therefore go to
/var/lib instead of /usr/share.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoImport our public signing key
Michael Tremer [Tue, 10 Dec 2019 18:09:22 +0000 (18:09 +0000)] 
Import our public signing key

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-downloader: Exit with 3 when the database was already up to date
Michael Tremer [Mon, 9 Dec 2019 20:15:58 +0000 (20:15 +0000)] 
location-downloader: Exit with 3 when the database was already up to date

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-exporter: Accept A1, A2, A3 as compat country codes
Michael Tremer [Mon, 9 Dec 2019 20:09:36 +0000 (20:09 +0000)] 
location-exporter: Accept A1, A2, A3 as compat country codes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-exporter: Allow exporting by family
Stefan Schantl [Sun, 8 Dec 2019 10:11:56 +0000 (11:11 +0100)] 
location-exporter: Allow exporting by family

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-query: Translate family only when it is set
Michael Tremer [Mon, 9 Dec 2019 17:08:59 +0000 (17:08 +0000)] 
location-query: Translate family only when it is set

Fixes: #12253
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Install location-exporter
Stefan Schantl [Fri, 6 Dec 2019 12:50:29 +0000 (13:50 +0100)] 
debian: Install location-exporter

This binary has no manpage yet, so lintian will provide a
warning of the non existing manpage.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-exporter: Uncomment accidentially commented line
Michael Tremer [Thu, 5 Dec 2019 17:20:23 +0000 (17:20 +0000)] 
location-exporter: Uncomment accidentially commented line

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-export: Validate country codes
Michael Tremer [Thu, 5 Dec 2019 15:47:16 +0000 (15:47 +0000)] 
location-export: Validate country codes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-exporter: ipset: Add line break after header
Michael Tremer [Thu, 5 Dec 2019 15:38:34 +0000 (15:38 +0000)] 
location-exporter: ipset: Add line break after header

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-exporter: Fix syntax errors for nftables export
Michael Tremer [Thu, 5 Dec 2019 15:37:26 +0000 (15:37 +0000)] 
location-exporter: Fix syntax errors for nftables export

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoperl: Make verify() a function on the database
Michael Tremer [Thu, 5 Dec 2019 15:34:06 +0000 (15:34 +0000)] 
perl: Make verify() a function on the database

This makes the API similar to the Python version

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-query: Do not validate database every time
Michael Tremer [Thu, 5 Dec 2019 14:54:29 +0000 (14:54 +0000)] 
location-query: Do not validate database every time

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-exporter: New script to convert database into compatible formats
Michael Tremer [Thu, 5 Dec 2019 14:48:00 +0000 (14:48 +0000)] 
location-exporter: New script to convert database into compatible formats

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-query: Allow filtering networks by family
Michael Tremer [Fri, 29 Nov 2019 19:44:25 +0000 (19:44 +0000)] 
location-query: Allow filtering networks by family

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-downloader: Verify the database after download
Michael Tremer [Fri, 29 Nov 2019 19:16:05 +0000 (19:16 +0000)] 
location-downloader: Verify the database after download

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoperl: Verify database when it is being opened
Stefan Schantl [Fri, 29 Nov 2019 19:01:45 +0000 (19:01 +0000)] 
perl: Verify database when it is being opened

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodatabase: Benchmark time it takes to verify the signature
Michael Tremer [Fri, 29 Nov 2019 18:56:25 +0000 (18:56 +0000)] 
database: Benchmark time it takes to verify the signature

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoImplement signing/verifying databases
Michael Tremer [Thu, 28 Nov 2019 15:03:16 +0000 (15:03 +0000)] 
Implement signing/verifying databases

Databases can now carry a builtin signature which can be verified
when the database is being loaded.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodatabase: Add scaffolding for checking signatures
Michael Tremer [Tue, 26 Nov 2019 22:29:05 +0000 (22:29 +0000)] 
database: Add scaffolding for checking signatures

The added function computes a SHA512 hash of the database
file where the signature is cleared.

The actual cryptographic check of the signature is
not implemented, yet.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoconfigure: Actually pass detected libraries over to make
Michael Tremer [Tue, 26 Nov 2019 21:41:52 +0000 (21:41 +0000)] 
configure: Actually pass detected libraries over to make

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoLink against OpenSSL
Michael Tremer [Tue, 26 Nov 2019 16:50:47 +0000 (16:50 +0000)] 
Link against OpenSSL

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoMakefile: Cleanup Debian tarball
Michael Tremer [Tue, 26 Nov 2019 16:38:01 +0000 (16:38 +0000)] 
Makefile: Cleanup Debian tarball

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodatabase: Log error when network ID is out of range
Michael Tremer [Tue, 26 Nov 2019 16:35:53 +0000 (16:35 +0000)] 
database: Log error when network ID is out of range

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Ignore all temporary files
Michael Tremer [Tue, 26 Nov 2019 13:51:21 +0000 (13:51 +0000)] 
debian: Ignore all temporary files

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Add command to build Debian packages easily
Michael Tremer [Tue, 26 Nov 2019 13:50:57 +0000 (13:50 +0000)] 
debian: Add command to build Debian packages easily

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoAdd support for packaging Debian (deb) packages
Stefan Schantl [Mon, 25 Nov 2019 17:52:29 +0000 (18:52 +0100)] 
Add support for packaging Debian (deb) packages

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoBump version to 0.9.0 0.9.0
Michael Tremer [Mon, 25 Nov 2019 16:56:26 +0000 (16:56 +0000)] 
Bump version to 0.9.0

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoconfigure: Fix platform detection
Michael Tremer [Mon, 25 Nov 2019 16:55:08 +0000 (16:55 +0000)] 
configure: Fix platform detection

Checking for GNU platforms now instead of just Linux.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoperl: Provide library location when running the testsuite
Stefan Schantl [Thu, 21 Nov 2019 14:51:51 +0000 (15:51 +0100)] 
perl: Provide library location when running the testsuite

Otherwise the perl testsuite could not locate libloc and will fail.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolibresolv: Check different functions on different platforms
Michael Tremer [Sun, 24 Nov 2019 21:05:23 +0000 (21:05 +0000)] 
libresolv: Check different functions on different platforms

I could not find a function that is both present on Linux and
Mac OS X, so we now have to test differently.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoMake library build on Mac OS X
Michael Tremer [Sun, 24 Nov 2019 20:58:03 +0000 (20:58 +0000)] 
Make library build on Mac OS X

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoFix building man pages on Mac OS X
Michael Tremer [Sat, 19 Oct 2019 11:10:26 +0000 (12:10 +0100)] 
Fix building man pages on Mac OS X

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodownloader: Check DNS for most recent version
Michael Tremer [Sun, 24 Nov 2019 19:20:00 +0000 (19:20 +0000)] 
downloader: Check DNS for most recent version

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopo: Update German translation
Michael Tremer [Fri, 22 Nov 2019 14:08:22 +0000 (14:08 +0000)] 
po: Update German translation

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoMakefile: Do not indent variable assignments
Michael Tremer [Fri, 22 Nov 2019 14:07:49 +0000 (14:07 +0000)] 
Makefile: Do not indent variable assignments

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoperl: Remove RPATH
Michael Tremer [Thu, 21 Nov 2019 12:48:18 +0000 (12:48 +0000)] 
perl: Remove RPATH

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-downloader: Add man page
Michael Tremer [Sun, 17 Nov 2019 14:55:31 +0000 (14:55 +0000)] 
location-downloader: Add man page

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoAdd systemd unit files for location-downloader
Michael Tremer [Sun, 17 Nov 2019 14:52:24 +0000 (14:52 +0000)] 
Add systemd unit files for location-downloader

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-downloader: Add proper logging infrastructure
Michael Tremer [Sun, 17 Nov 2019 13:57:40 +0000 (13:57 +0000)] 
location-downloader: Add proper logging infrastructure

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoAdd download script to automatically update the database
Michael Tremer [Sun, 17 Nov 2019 13:45:39 +0000 (13:45 +0000)] 
Add download script to automatically update the database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-query: Add listing networks by flags
Michael Tremer [Fri, 15 Nov 2019 15:58:59 +0000 (15:58 +0000)] 
location-query: Add listing networks by flags

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoFix names of flags
Michael Tremer [Fri, 15 Nov 2019 15:26:22 +0000 (15:26 +0000)] 
Fix names of flags

They belong to the networks, so that should be reflected in the name.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-query: Add output for ipset
Michael Tremer [Fri, 15 Nov 2019 14:22:35 +0000 (14:22 +0000)] 
location-query: Add output for ipset

Fixes: #12202
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-query: Allow exporting data for nftables
Michael Tremer [Fri, 15 Nov 2019 14:18:59 +0000 (14:18 +0000)] 
location-query: Allow exporting data for nftables

Fixes: #12201
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-query: Support listing networks for xt_geoip
Michael Tremer [Fri, 15 Nov 2019 13:53:02 +0000 (13:53 +0000)] 
location-query: Support listing networks for xt_geoip

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agonetwork: Initialize country code with nothing
Michael Tremer [Fri, 15 Nov 2019 11:22:56 +0000 (11:22 +0000)] 
network: Initialize country code with nothing

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoImprove error reporting when a network could not be read from the database
Michael Tremer [Fri, 15 Nov 2019 11:20:08 +0000 (11:20 +0000)] 
Improve error reporting when a network could not be read from the database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopython: Raise error when a network/AS could not be read
Michael Tremer [Fri, 15 Nov 2019 11:14:39 +0000 (11:14 +0000)] 
python: Raise error when a network/AS could not be read

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agotest-stringpool: Include stdint.h on Linux
Michael Tremer [Tue, 22 Oct 2019 08:42:41 +0000 (08:42 +0000)] 
test-stringpool: Include stdint.h on Linux

This is required to have intmax_t declared.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoFix off_t casting in tests
Michael Tremer [Sat, 19 Oct 2019 10:54:52 +0000 (11:54 +0100)] 
Fix off_t casting in tests

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agodatabase: Fix checking pointer
Michael Tremer [Sat, 19 Oct 2019 10:53:34 +0000 (11:53 +0100)] 
database: Fix checking pointer

This always evaluated to true which is not what was intended here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoCorrect cast off_t to intmax_t before printing it
Michael Tremer [Sat, 19 Oct 2019 10:51:59 +0000 (11:51 +0100)] 
Correct cast off_t to intmax_t before printing it

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoMerge branch 'apple'
Michael Tremer [Fri, 18 Oct 2019 18:43:59 +0000 (19:43 +0100)] 
Merge branch 'apple'

5 months agoperl: Do not insist on Perl 5.28 or higher
Michael Tremer [Fri, 18 Oct 2019 18:43:27 +0000 (19:43 +0100)] 
perl: Do not insist on Perl 5.28 or higher

We have no special requirements here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agolinker: Do not use --gc-sections on non-GNU platforms
Michael Tremer [Fri, 18 Oct 2019 18:36:21 +0000 (19:36 +0100)] 
linker: Do not use --gc-sections on non-GNU platforms

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agocountry: Include compat.h to build on other arches
Michael Tremer [Fri, 18 Oct 2019 18:22:51 +0000 (19:22 +0100)] 
country: Include compat.h to build on other arches

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agocountry: Fix comparison function
Michael Tremer [Thu, 17 Oct 2019 15:45:19 +0000 (15:45 +0000)] 
country: Fix comparison function

This return value was incorrect which caused that sorting
countries did not work and therefore could not been found
in the database any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agotest: Add another country for test
Michael Tremer [Thu, 17 Oct 2019 15:45:06 +0000 (15:45 +0000)] 
test: Add another country for test

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoDetect if linker supports --version-script=
Michael Tremer [Sat, 12 Jan 2019 16:18:26 +0000 (16:18 +0000)] 
Detect if linker supports --version-script=

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoFormat off_t data types properly for printing
Michael Tremer [Sat, 12 Jan 2019 16:07:31 +0000 (16:07 +0000)] 
Format off_t data types properly for printing

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoMake package compile on Mac OS X
Michael Tremer [Sat, 12 Jan 2019 15:57:29 +0000 (15:57 +0000)] 
Make package compile on Mac OS X

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoFall back to getenv() when secure_getenv() is not available
Michael Tremer [Sat, 12 Jan 2019 15:25:54 +0000 (15:25 +0000)] 
Fall back to getenv() when secure_getenv() is not available

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agopython: Implement lookup function for countries
Michael Tremer [Tue, 15 Oct 2019 15:21:21 +0000 (15:21 +0000)] 
python: Implement lookup function for countries

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agopython: Extend bindings for countries
Michael Tremer [Tue, 15 Oct 2019 15:10:26 +0000 (15:10 +0000)] 
python: Extend bindings for countries

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agowriter: Write countries before pool is being written
Michael Tremer [Tue, 15 Oct 2019 15:06:31 +0000 (15:06 +0000)] 
writer: Write countries before pool is being written

Otherwise the names will obviously not be written

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agocountry: Fix segmentation fault when continent code is not set
Michael Tremer [Tue, 15 Oct 2019 14:44:36 +0000 (14:44 +0000)] 
country: Fix segmentation fault when continent code is not set

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agocountry: Remove string termination
Michael Tremer [Tue, 15 Oct 2019 14:01:30 +0000 (14:01 +0000)] 
country: Remove string termination

This should not be necessary and overwrites the buffer
in some cases.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agodatabase format: Add some padding to header
Michael Tremer [Tue, 15 Oct 2019 13:58:07 +0000 (13:58 +0000)] 
database format: Add some padding to header

This can be used to add things later without
incrementing the database version.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoFix re-ordering flags which are now only 16 bits
Michael Tremer [Tue, 15 Oct 2019 13:56:14 +0000 (13:56 +0000)] 
Fix re-ordering flags which are now only 16 bits

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agocountry: Use one function to copy country codes
Michael Tremer [Tue, 15 Oct 2019 13:54:42 +0000 (13:54 +0000)] 
country: Use one function to copy country codes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agocountry: Add simple function to test if a country code is valid
Michael Tremer [Tue, 15 Oct 2019 13:40:02 +0000 (13:40 +0000)] 
country: Add simple function to test if a country code is valid

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agocountry: Fix SEGV when accessing the string pool
Michael Tremer [Tue, 15 Oct 2019 13:30:05 +0000 (13:30 +0000)] 
country: Fix SEGV when accessing the string pool

This was caused because I am too stupid to count to two.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agodatabase format: Reduce number of flags to 16
Michael Tremer [Tue, 15 Oct 2019 13:23:19 +0000 (13:23 +0000)] 
database format: Reduce number of flags to 16

32 is very excessive and I hope we will never need that many.
Hence we reserve the remaining space.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoAdd a dictionary with countries to the database
Michael Tremer [Tue, 15 Oct 2019 13:20:20 +0000 (13:20 +0000)] 
Add a dictionary with countries to the database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agopython: Use shorthand function to export __version__
Michael Tremer [Sun, 13 Oct 2019 17:41:34 +0000 (17:41 +0000)] 
python: Use shorthand function to export __version__

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agopython: Expose flags
Michael Tremer [Sun, 13 Oct 2019 17:38:53 +0000 (17:38 +0000)] 
python: Expose flags

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoHandle A1, A2, A3 as special cases when searching for countries
Michael Tremer [Sun, 13 Oct 2019 17:24:17 +0000 (17:24 +0000)] 
Handle A1, A2, A3 as special cases when searching for countries

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoImplement searching for networks with a certain flag
Michael Tremer [Sun, 13 Oct 2019 17:02:51 +0000 (17:02 +0000)] 
Implement searching for networks with a certain flag

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoAdd flags for A1, A2 and A3
Michael Tremer [Sun, 13 Oct 2019 16:57:33 +0000 (16:57 +0000)] 
Add flags for A1, A2 and A3

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 months agoAdd flags to network objects
Michael Tremer [Sun, 13 Oct 2019 16:49:57 +0000 (16:49 +0000)] 
Add flags to network objects

This changes the database format on disk.

Flags can be used to mark networks in order to add more information
later than only ASN and CC.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 months agoman: Add location-query.8
Michael Tremer [Thu, 3 Oct 2019 20:03:07 +0000 (20:03 +0000)] 
man: Add location-query.8

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 months agodatabase: Print timings in milliseconds
Michael Tremer [Thu, 3 Oct 2019 19:14:47 +0000 (19:14 +0000)] 
database: Print timings in milliseconds

We are so fast that seconds do not make any sense.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 months agotest: Fix compiling AS test after header change
Michael Tremer [Thu, 3 Oct 2019 18:47:37 +0000 (18:47 +0000)] 
test: Fix compiling AS test after header change

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 months agoMerge branch 'perl'
Michael Tremer [Thu, 3 Oct 2019 18:44:49 +0000 (18:44 +0000)] 
Merge branch 'perl'

6 months agoperl: Testsuite: Add tests for lookup_asn()
Stefan Schantl [Wed, 2 Oct 2019 17:25:51 +0000 (19:25 +0200)] 
perl: Testsuite: Add tests for lookup_asn()

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 months agoperl: Add function to perform AS number lookups.
Stefan Schantl [Wed, 2 Oct 2019 17:10:21 +0000 (19:10 +0200)] 
perl: Add function to perform AS number lookups.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 months agoperl: Testsuite: Add tests for invalid address and address not in the database.
Stefan Schantl [Wed, 2 Oct 2019 17:07:53 +0000 (19:07 +0200)] 
perl: Testsuite: Add tests for invalid address and address not in the database.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 months agoperl: Fix lookup if given address is invalid or not in DB.
Stefan Schantl [Wed, 2 Oct 2019 17:07:52 +0000 (19:07 +0200)] 
perl: Fix lookup if given address is invalid or not in DB.

In this case now undef will be returned.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>