]> git.ipfire.org Git - people/ms/libloc.git/log
people/ms/libloc.git
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years agoMerge branch 'perl'
Michael Tremer [Thu, 3 Oct 2019 18:44:49 +0000 (18:44 +0000)] 
Merge branch 'perl'

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years agolocation-query: Fix wrong variable name
Michael Tremer [Thu, 3 Oct 2019 18:42:17 +0000 (18:42 +0000)] 
location-query: Fix wrong variable name

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoImplement listing all IP addresses in an AS
Michael Tremer [Thu, 3 Oct 2019 18:41:38 +0000 (18:41 +0000)] 
Implement listing all IP addresses in an AS

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agodatabase: Fix use-after-free error after last iteration of search
Michael Tremer [Thu, 3 Oct 2019 18:38:14 +0000 (18:38 +0000)] 
database: Fix use-after-free error after last iteration of search

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoChange how errors are handled by iterators
Michael Tremer [Thu, 3 Oct 2019 18:22:39 +0000 (18:22 +0000)] 
Change how errors are handled by iterators

Instead of returning a pointer, we are returning an
exit code and a pointer is being set to the object.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agolocation-query: Print usage when no action was given
Michael Tremer [Thu, 3 Oct 2019 18:07:31 +0000 (18:07 +0000)] 
location-query: Print usage when no action was given

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoImplement listing networks in Python
Michael Tremer [Thu, 3 Oct 2019 18:02:07 +0000 (18:02 +0000)] 
Implement listing networks in Python

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoImplement filtering networks for the ASN they belong to
Michael Tremer [Thu, 3 Oct 2019 15:47:48 +0000 (15:47 +0000)] 
Implement filtering networks for the ASN they belong to

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoRemove some dead code and add some comments
Michael Tremer [Thu, 3 Oct 2019 15:36:18 +0000 (15:36 +0000)] 
Remove some dead code and add some comments

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoMark all nodes as non-visited after walk through tree has completed
Michael Tremer [Thu, 3 Oct 2019 15:30:53 +0000 (15:30 +0000)] 
Mark all nodes as non-visited after walk through tree has completed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoFree visited network nodes when enumerator is deallocated, too
Michael Tremer [Thu, 3 Oct 2019 15:20:09 +0000 (15:20 +0000)] 
Free visited network nodes when enumerator is deallocated, too

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoImplement search through the network tree
Michael Tremer [Thu, 3 Oct 2019 15:13:03 +0000 (15:13 +0000)] 
Implement search through the network tree

This could not be implemented as a usual DFS since we cannot simply
have a recursive solution here and need to be able to break the
search at any time.

However, it needs to be tracked where in the graph we are when we
are walking through it to extract the informaton encoded into the
edges.

This is now solved by using a stack that keeps that information
as we walk through the graph.

This solution uses O(1) in memory since the stack can not be larger
than 256 nodes (the maximum path length should be 128).

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agolibloc: Add function to set country code to database enumerator
Michael Tremer [Wed, 2 Oct 2019 14:07:13 +0000 (14:07 +0000)] 
libloc: Add function to set country code to database enumerator

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agolocation-query: Allow passing the database path
Michael Tremer [Wed, 2 Oct 2019 13:55:33 +0000 (13:55 +0000)] 
location-query: Allow passing the database path

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agotest: Generate database dynamically
Michael Tremer [Tue, 1 Oct 2019 12:24:04 +0000 (12:24 +0000)] 
test: Generate database dynamically

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Use absolute paths for opening database
Michael Tremer [Tue, 1 Oct 2019 12:10:14 +0000 (12:10 +0000)] 
perl: Use absolute paths for opening database

This makes distcheck happy which runs the build in a different
directory from the source directory.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agotest: Include test database in tarball
Michael Tremer [Tue, 1 Oct 2019 12:09:43 +0000 (12:09 +0000)] 
test: Include test database in tarball

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Add tests to testsuite.
Stefan Schantl [Tue, 1 Oct 2019 06:15:54 +0000 (08:15 +0200)] 
perl: Add tests to testsuite.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoAdd example database for testing purposes.
Stefan Schantl [Tue, 1 Oct 2019 06:02:03 +0000 (08:02 +0200)] 
Add example database for testing purposes.

This example database and it's content can be used for
various testing purposes.

The testsuite of the perl bindings depends on it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoexamples: python/create-database.py: Add license to database
Stefan Schantl [Tue, 1 Oct 2019 05:59:50 +0000 (07:59 +0200)] 
examples: python/create-database.py: Add license to database

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Automatically build modules
Michael Tremer [Sun, 29 Sep 2019 14:21:48 +0000 (14:21 +0000)] 
perl: Automatically build modules

Fixes: #12192
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Move perl module to src/perl
Michael Tremer [Sun, 29 Sep 2019 13:08:54 +0000 (13:08 +0000)] 
perl: Move perl module to src/perl

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Add function to gather the license of a database.
Stefan Schantl [Sun, 29 Sep 2019 09:55:56 +0000 (11:55 +0200)] 
perl: Add function to gather the license of a database.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Add function to get the description of the database.
Stefan Schantl [Sun, 29 Sep 2019 09:55:12 +0000 (11:55 +0200)] 
perl: Add function to get the description of the database.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Fix comments outside of a C code block.
Stefan Schantl [Sun, 29 Sep 2019 09:53:46 +0000 (11:53 +0200)] 
perl: Fix comments outside of a C code block.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Move database functions up and lookup functions down
Michael Tremer [Sat, 28 Sep 2019 16:30:02 +0000 (16:30 +0000)] 
perl: Move database functions up and lookup functions down

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Rename lookup function to be more consistent with the Python bindings
Michael Tremer [Sat, 28 Sep 2019 16:25:26 +0000 (16:25 +0000)] 
perl: Rename lookup function to be more consistent with the Python bindings

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Rename database_get_vendor() to get_vendor(9
Michael Tremer [Sat, 28 Sep 2019 16:23:50 +0000 (16:23 +0000)] 
perl: Rename database_get_vendor() to get_vendor(9

This function is being called on the database object, so it makes
sense to call it this as it is shorter.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: MANIFEST: Drop ppport.h
Michael Tremer [Sat, 28 Sep 2019 16:23:04 +0000 (16:23 +0000)] 
perl: MANIFEST: Drop ppport.h

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Remove another useless initialisation
Michael Tremer [Sat, 28 Sep 2019 16:21:10 +0000 (16:21 +0000)] 
perl: Remove another useless initialisation

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Return NULL when no country code was found
Michael Tremer [Sat, 28 Sep 2019 16:20:56 +0000 (16:20 +0000)] 
perl: Return NULL when no country code was found

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: No need to copy vendor onto the heap
Michael Tremer [Thu, 26 Sep 2019 18:08:20 +0000 (18:08 +0000)] 
perl: No need to copy vendor onto the heap

This is already and will be allocated as long as the database is

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Mode code re-formatting
Michael Tremer [Thu, 26 Sep 2019 18:02:43 +0000 (18:02 +0000)] 
perl: Mode code re-formatting

No functional changes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Close database file after it has been read
Michael Tremer [Thu, 26 Sep 2019 17:55:54 +0000 (17:55 +0000)] 
perl: Close database file after it has been read

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: perl does not allow to initialise the variables
Michael Tremer [Thu, 26 Sep 2019 17:55:35 +0000 (17:55 +0000)] 
perl: perl does not allow to initialise the variables

They will always be NULL.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agodatabase: Free stringpool only after it has been initialised
Michael Tremer [Thu, 26 Sep 2019 17:45:16 +0000 (17:45 +0000)] 
database: Free stringpool only after it has been initialised

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Release location context when opening the database fails
Michael Tremer [Thu, 26 Sep 2019 17:39:38 +0000 (17:39 +0000)] 
perl: Release location context when opening the database fails

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Add some basic comments
Michael Tremer [Thu, 26 Sep 2019 17:26:05 +0000 (17:26 +0000)] 
perl: Add some basic comments

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Improve error messages
Michael Tremer [Thu, 26 Sep 2019 17:23:43 +0000 (17:23 +0000)] 
perl: Improve error messages

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Fix code formatting and initialise some variables
Michael Tremer [Thu, 26 Sep 2019 17:20:25 +0000 (17:20 +0000)] 
perl: Fix code formatting and initialise some variables

No functional changes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Add .gitignore
Michael Tremer [Thu, 26 Sep 2019 17:13:34 +0000 (17:13 +0000)] 
perl: Add .gitignore

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Drop ppport.h
Michael Tremer [Thu, 26 Sep 2019 17:13:04 +0000 (17:13 +0000)] 
perl: Drop ppport.h

This file is not needed according to itself.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Remove unneeded/unwanted files.
Stefan Schantl [Wed, 25 Sep 2019 17:59:41 +0000 (19:59 +0200)] 
perl: Remove unneeded/unwanted files.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 years agoperl: Add perl bindings for libloc.
Stefan Schantl [Wed, 25 Sep 2019 13:59:48 +0000 (15:59 +0200)] 
perl: Add perl bindings for libloc.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 years agopython: Avoid declaring loc_ctx multiple times
Michael Tremer [Sat, 12 Jan 2019 16:20:35 +0000 (16:20 +0000)] 
python: Avoid declaring loc_ctx multiple times

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 years agoPass right variable to IN6_IN_ADDR_* functions
Michael Tremer [Sat, 12 Jan 2019 16:10:04 +0000 (16:10 +0000)] 
Pass right variable to IN6_IN_ADDR_* functions

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 years agoFix evaluation that always is true
Michael Tremer [Sat, 12 Jan 2019 16:09:35 +0000 (16:09 +0000)] 
Fix evaluation that always is true

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 years agopython: Do not use any GNU-style initialisers for structs
Michael Tremer [Sat, 12 Jan 2019 16:02:57 +0000 (16:02 +0000)] 
python: Do not use any GNU-style initialisers for structs

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agolocation-query: Use print to print errors, too
Michael Tremer [Thu, 1 Feb 2018 14:22:36 +0000 (14:22 +0000)] 
location-query: Use print to print errors, too

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoFix searching for ASes
Michael Tremer [Thu, 1 Feb 2018 14:19:30 +0000 (14:19 +0000)] 
Fix searching for ASes

The name of the AS has not been converted to lowercase
before which causes that we didn't find all ASes.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agolocation-query: Implement searching for an AS that matches a string
Michael Tremer [Thu, 1 Feb 2018 14:18:15 +0000 (14:18 +0000)] 
location-query: Implement searching for an AS that matches a string

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoi18n: Ignore compiled translation files
Michael Tremer [Thu, 1 Feb 2018 14:14:19 +0000 (14:14 +0000)] 
i18n: Ignore compiled translation files

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agolocation-query: Implement getting information about an AS
Michael Tremer [Thu, 1 Feb 2018 14:13:48 +0000 (14:13 +0000)] 
location-query: Implement getting information about an AS

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoi18n: Add German translation
Michael Tremer [Thu, 1 Feb 2018 14:06:36 +0000 (14:06 +0000)] 
i18n: Add German translation

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoAdd internationalisation with intltool and gettext
Michael Tremer [Thu, 1 Feb 2018 14:04:25 +0000 (14:04 +0000)] 
Add internationalisation with intltool and gettext

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agopython: Raise proper error when database does not exist
Michael Tremer [Thu, 1 Feb 2018 13:39:27 +0000 (13:39 +0000)] 
python: Raise proper error when database does not exist

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agopython: Expose version of the module
Michael Tremer [Thu, 1 Feb 2018 13:33:38 +0000 (13:33 +0000)] 
python: Expose version of the module

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoMakefile: Configure database directory
Michael Tremer [Thu, 1 Feb 2018 13:20:06 +0000 (13:20 +0000)] 
Makefile: Configure database directory

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agopython: Add script to lookup database from command line
Michael Tremer [Thu, 1 Feb 2018 13:00:44 +0000 (13:00 +0000)] 
python: Add script to lookup database from command line

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agopython: Add function to set log level
Michael Tremer [Thu, 1 Feb 2018 11:54:01 +0000 (11:54 +0000)] 
python: Add function to set log level

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoFix getting wrong bits in IP addresses
Michael Tremer [Wed, 31 Jan 2018 21:45:21 +0000 (21:45 +0000)] 
Fix getting wrong bits in IP addresses

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agotest: Fix network test for non-existant address
Michael Tremer [Wed, 31 Jan 2018 00:31:41 +0000 (00:31 +0000)] 
test: Fix network test for non-existant address

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agodatabase: Remove inexact match
Michael Tremer [Wed, 31 Jan 2018 00:28:33 +0000 (00:28 +0000)] 
database: Remove inexact match

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agodatabase: Walk down into the tree as much as possible first
Michael Tremer [Tue, 30 Jan 2018 23:29:52 +0000 (23:29 +0000)] 
database: Walk down into the tree as much as possible first

Instead of stopping when we find the largest network that
matches, we will have to go as deep as we can and then
check all networks on the way from the bottom up.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agonetwork: Fix checking upper bound when matching IP addresses
Michael Tremer [Tue, 30 Jan 2018 23:29:28 +0000 (23:29 +0000)] 
network: Fix checking upper bound when matching IP addresses

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoRefactor compating IP addresses
Michael Tremer [Tue, 30 Jan 2018 23:28:21 +0000 (23:28 +0000)] 
Refactor compating IP addresses

memcmp does not seem to be the best choice here.

This function is a naive implementation
but does the job very well.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agodatabase: Improve error logging when da network could not be loaded
Michael Tremer [Tue, 30 Jan 2018 22:33:55 +0000 (22:33 +0000)] 
database: Improve error logging when da network could not be loaded

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agodatabase: Encode prefix length into tree
Michael Tremer [Tue, 30 Jan 2018 22:30:46 +0000 (22:30 +0000)] 
database: Encode prefix length into tree

To keep the tree smaller and to not have too many sparse
nodes in it that waste a lot of memory, we encode the
prefix now into the tree as depth.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agonetwork: Allow setting an empty country code
Michael Tremer [Tue, 30 Jan 2018 22:29:45 +0000 (22:29 +0000)] 
network: Allow setting an empty country code

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agopython: Show country code that was invalid
Michael Tremer [Tue, 30 Jan 2018 16:02:24 +0000 (16:02 +0000)] 
python: Show country code that was invalid

Makes debugging easier

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agopython: Raise IndexError when adding the same network twice
Michael Tremer [Tue, 30 Jan 2018 15:37:40 +0000 (15:37 +0000)] 
python: Raise IndexError when adding the same network twice

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agowriter: Throw better exception when network address was invalid
Michael Tremer [Tue, 30 Jan 2018 15:24:45 +0000 (15:24 +0000)] 
writer: Throw better exception when network address was invalid

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agonetwork: Fix underflow in for loop when generating bitmask
Michael Tremer [Tue, 30 Jan 2018 15:16:15 +0000 (15:16 +0000)] 
network: Fix underflow in for loop when generating bitmask

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoFix another typo
Michael Tremer [Mon, 8 Jan 2018 19:00:19 +0000 (19:00 +0000)] 
Fix another typo

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agopython: Implement searching for ASes
Michael Tremer [Thu, 25 Jan 2018 22:02:52 +0000 (22:02 +0000)] 
python: Implement searching for ASes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agodatabase: Implement searching for ASes that match a string
Michael Tremer [Thu, 25 Jan 2018 21:26:48 +0000 (21:26 +0000)] 
database: Implement searching for ASes that match a string

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoAdd database enumerator interface to perform iterative searches
Michael Tremer [Thu, 25 Jan 2018 20:44:45 +0000 (20:44 +0000)] 
Add database enumerator interface to perform iterative searches

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoWhen formatting an IP address only pass the actual IP address
Michael Tremer [Mon, 8 Jan 2018 18:58:00 +0000 (18:58 +0000)] 
When formatting an IP address only pass the actual IP address

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agonetwork: Fix calculating the last IP address of a network
Michael Tremer [Mon, 8 Jan 2018 18:56:00 +0000 (18:56 +0000)] 
network: Fix calculating the last IP address of a network

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoCorrectly handle invalid IP addresses
Michael Tremer [Mon, 8 Jan 2018 18:42:21 +0000 (18:42 +0000)] 
Correctly handle invalid IP addresses

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agodatabase: Make level variable unsigned (as used in log messages)
Michael Tremer [Mon, 8 Jan 2018 18:36:49 +0000 (18:36 +0000)] 
database: Make level variable unsigned (as used in log messages)

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoFix typo in comparison function
Michael Tremer [Mon, 8 Jan 2018 18:29:29 +0000 (18:29 +0000)] 
Fix typo in comparison function

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoFix typo
Michael Tremer [Mon, 8 Jan 2018 18:25:28 +0000 (18:25 +0000)] 
Fix typo

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agodatabase: Stop walking down the tree when we hit a leaf node
Michael Tremer [Mon, 8 Jan 2018 18:06:13 +0000 (18:06 +0000)] 
database: Stop walking down the tree when we hit a leaf node

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agoAdd license attribute to the database
Michael Tremer [Mon, 8 Jan 2018 17:57:46 +0000 (17:57 +0000)] 
Add license attribute to the database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 years agopython: Save path when opening the database
Michael Tremer [Mon, 8 Jan 2018 17:46:17 +0000 (17:46 +0000)] 
python: Save path when opening the database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>