people/ms/libloc.git
32 hours agoMakefile.am: Do not specify CC and LD when building perl module. master
Stefan Schantl [Tue, 23 Feb 2021 20:15:57 +0000 (21:15 +0100)] 
Makefile.am: Do not specify CC and LD when building perl module.

Specifing the CC and LD flags is not required because perl MakeMaker
takes care of this.

Fixes #12574.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoMakefile.am: Do not provide PREFIX value for perl build.
Stefan Schantl [Mon, 22 Feb 2021 20:07:21 +0000 (21:07 +0100)] 
Makefile.am: Do not provide PREFIX value for perl build.

This caused to gain the following error when building:

Only one of PREFIX or INSTALL_BASE can be given. Not both.

Using INSTALLDIRS=vendor is the common way to get the modules installed
into the right directories.

Fixes #12573.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agolocation-importer.in: reduce log noise for unusable networks
Peter Müller [Sat, 16 Jan 2021 18:09:39 +0000 (19:09 +0100)] 
location-importer.in: reduce log noise for unusable networks

These are nothing to worry about, which is why debug log facility is
more suitable here than informational or warning.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agolocation-importer.in: delete 6to4 IPv6 space as well
Peter Müller [Sat, 16 Jan 2021 18:05:33 +0000 (19:05 +0100)] 
location-importer.in: delete 6to4 IPv6 space as well

2002::/16 is an anycast prefix for 6to4 scenarios, as specified in RFC
3068. We currently process an announcement from Hurricane Electric for
it, and since it is an anycast network, multiple entities across the
world announce it as well.

Thereof, it does not make sense to include it in the database - as of
today, we do not have a country for it, either.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agolocation-importer.in: fix typo
Peter Müller [Wed, 23 Dec 2020 14:10:52 +0000 (15:10 +0100)] 
location-importer.in: fix typo

Fixes: #12549

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agolocation: Fix list-networks-by-as
Michael Tremer [Mon, 21 Dec 2020 16:25:46 +0000 (16:25 +0000)] 
location: Fix list-networks-by-as

Fixes: #12554
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agodebian: Sync version 0.9.5
Michael Tremer [Wed, 2 Dec 2020 17:40:30 +0000 (17:40 +0000)] 
debian: Sync version

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agodatabase: Restart flatten algorithm from the top when a network was dropped
Michael Tremer [Tue, 1 Dec 2020 16:58:29 +0000 (16:58 +0000)] 
database: Restart flatten algorithm from the top when a network was dropped

We used to simply take the first element from the stack after we have
split a network. That is wrong because it is not passing through any
filters and no further subnet checks. It could have therefore been
that the tree was not entirely flat.

Reported-by: Arne Fitzenreiter <arne_f@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Exit find operation early when the list is empty
Michael Tremer [Fri, 27 Nov 2020 15:40:20 +0000 (15:40 +0000)] 
network-list: Exit find operation early when the list is empty

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: Do not check whether an integer is larger than 32 bit on 32 bit arches
Michael Tremer [Fri, 27 Nov 2020 15:37:22 +0000 (15:37 +0000)] 
python: Do not check whether an integer is larger than 32 bit on 32 bit arches

This cannot happen and generated a compiler warning

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: PyList_Size returns ssize_t which is signed
Michael Tremer [Fri, 27 Nov 2020 15:33:06 +0000 (15:33 +0000)] 
python: PyList_Size returns ssize_t which is signed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoSilence compiler formatting warnings for size_t
Michael Tremer [Fri, 27 Nov 2020 15:31:39 +0000 (15:31 +0000)] 
Silence compiler formatting warnings for size_t

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoconfigure: Adjust man-pages switch with documentation
Michael Tremer [Fri, 27 Nov 2020 15:27:08 +0000 (15:27 +0000)] 
configure: Adjust man-pages switch with documentation

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoas-list/country-list: Set elements list to zero after freeing it
Michael Tremer [Thu, 26 Nov 2020 10:19:26 +0000 (10:19 +0000)] 
as-list/country-list: Set elements list to zero after freeing it

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Add greater elements after the current one
Michael Tremer [Thu, 26 Nov 2020 10:14:18 +0000 (10:14 +0000)] 
network-list: Add greater elements after the current one

The list was otherwise not sorted

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Add more networks to test
Michael Tremer [Thu, 26 Nov 2020 10:14:08 +0000 (10:14 +0000)] 
network-list: Add more networks to test

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Copy flags when split into subnets
Michael Tremer [Thu, 26 Nov 2020 09:54:07 +0000 (09:54 +0000)] 
network: Copy flags when split into subnets

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoconfigure: Bump version to 0.9.5
Michael Tremer [Wed, 25 Nov 2020 20:00:46 +0000 (20:00 +0000)] 
configure: Bump version to 0.9.5

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Use clear function to tidy up
Michael Tremer [Wed, 25 Nov 2020 15:24:43 +0000 (15:24 +0000)] 
network-list: Use clear function to tidy up

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Include network header
Michael Tremer [Wed, 25 Nov 2020 15:17:42 +0000 (15:17 +0000)] 
network-list: Include network header

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Remove deprecated sort call
Michael Tremer [Wed, 25 Nov 2020 15:17:21 +0000 (15:17 +0000)] 
network: Remove deprecated sort call

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Massively improve performance on exclude
Michael Tremer [Wed, 25 Nov 2020 15:16:06 +0000 (15:16 +0000)] 
network: Massively improve performance on exclude

When we check the result for any overlaps, we can cut this short
by walking through both lists from start to end and remember the
last network that we checked.

The next one will by definition be strictly greater and therefore
we do not need to check anything before this any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Call subnet function with the correct order of arguments
Michael Tremer [Wed, 25 Nov 2020 15:15:33 +0000 (15:15 +0000)] 
network: Call subnet function with the correct order of arguments

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Add more excluded networks straight to the to_check list
Michael Tremer [Wed, 25 Nov 2020 15:14:31 +0000 (15:14 +0000)] 
network: Add more excluded networks straight to the to_check list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Do not execute with an error when the excluded result will be empty
Michael Tremer [Wed, 25 Nov 2020 15:13:08 +0000 (15:13 +0000)] 
network: Do not execute with an error when the excluded result will be empty

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Remove comparing family
Michael Tremer [Wed, 25 Nov 2020 15:11:21 +0000 (15:11 +0000)] 
networks: Remove comparing family

Everything is encoded in IPv6 anyways...

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Add tests for overlaps function
Michael Tremer [Wed, 25 Nov 2020 14:44:56 +0000 (14:44 +0000)] 
networks: Add tests for overlaps function

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Remove useless comment
Michael Tremer [Wed, 25 Nov 2020 14:44:23 +0000 (14:44 +0000)] 
network-list: Remove useless comment

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Show index when listing networks
Michael Tremer [Wed, 25 Nov 2020 14:43:58 +0000 (14:43 +0000)] 
network-list: Show index when listing networks

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Do not half list when popping the first element
Michael Tremer [Wed, 25 Nov 2020 14:42:26 +0000 (14:42 +0000)] 
network-list: Do not half list when popping the first element

The list was unfortunately halved in size every time an element
was taken from it, which was great for performance, but shortened
the result substantially.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Set elements pointer to NULL so that we know it is empty
Michael Tremer [Wed, 25 Nov 2020 14:41:39 +0000 (14:41 +0000)] 
network-list: Set elements pointer to NULL so that we know it is empty

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Check last element before doing binary search
Michael Tremer [Tue, 24 Nov 2020 19:39:35 +0000 (19:39 +0000)] 
network-list: Check last element before doing binary search

This is helpful because very often we walk through a list in
order and are most interested in the last element.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Use binary search to find if a network is a subnet
Michael Tremer [Tue, 24 Nov 2020 16:57:28 +0000 (16:57 +0000)] 
network-list: Use binary search to find if a network is a subnet

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Adjust return codes of loc_network_match_address and add test
Michael Tremer [Tue, 24 Nov 2020 16:50:17 +0000 (16:50 +0000)] 
network: Adjust return codes of loc_network_match_address and add test

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoDrop loc_network_gt which is now unused
Michael Tremer [Tue, 24 Nov 2020 15:50:39 +0000 (15:50 +0000)] 
Drop loc_network_gt which is now unused

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoDrop loc_network_eq in favour of loc_network_cmp
Michael Tremer [Tue, 24 Nov 2020 15:48:55 +0000 (15:48 +0000)] 
Drop loc_network_eq in favour of loc_network_cmp

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agotest: Add more networks to list to see the algorithm work
Michael Tremer [Tue, 24 Nov 2020 15:42:54 +0000 (15:42 +0000)] 
test: Add more networks to list to see the algorithm work

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Add excluded networks to to_check list
Michael Tremer [Tue, 24 Nov 2020 15:41:53 +0000 (15:41 +0000)] 
network: Add excluded networks to to_check list

This is now being done immediately instead of creating a new
list which is being merged later.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Read the first element from the list
Michael Tremer [Tue, 24 Nov 2020 15:22:02 +0000 (15:22 +0000)] 
database: Read the first element from the list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Avoid merging the same data twice
Michael Tremer [Tue, 24 Nov 2020 15:15:59 +0000 (15:15 +0000)] 
database: Avoid merging the same data twice

When finish splitting networks into many parts, we have
a list of subnets with the excluded subnets and merge them
together first and put them on the stack again.

This is slower than pushing it all onto the stack first
and then popping the first element.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Drop sorting functions
Michael Tremer [Tue, 24 Nov 2020 15:04:03 +0000 (15:04 +0000)] 
network-list: Drop sorting functions

Since the list is always sorted, there is no point in
sorting it again...

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Make this a sorted list
Michael Tremer [Tue, 24 Nov 2020 14:55:08 +0000 (14:55 +0000)] 
network-list: Make this a sorted list

The list is now organised so that it is always ordered.

This allows us to find if a network is on the list a lot
quicker using binary search as well as inserting a new
network at the right place.

This will benefit loc_network_exclude with very large networks.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Remove deprecated loc_network_is_subnet_of function
Michael Tremer [Fri, 20 Nov 2020 18:44:42 +0000 (18:44 +0000)] 
network: Remove deprecated loc_network_is_subnet_of function

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Speed up subnet check
Michael Tremer [Fri, 20 Nov 2020 18:39:13 +0000 (18:39 +0000)] 
network: Speed up subnet check

There is no point in checking different address families
with each other and we do not need to compare addresses
when the prefix of the subnet does not fit into the
network to check.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Add function to return the prefix
Michael Tremer [Fri, 20 Nov 2020 18:38:47 +0000 (18:38 +0000)] 
network: Add function to return the prefix

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Optimise _subnet function
Michael Tremer [Fri, 20 Nov 2020 18:36:48 +0000 (18:36 +0000)] 
network: Optimise _subnet function

This function used to create a network list which always
had exactly two elements. Since splitting a network in half
always returns two parts, we can simply return them as a
pointer.

This improves returning the network tree by about 17%.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork-list: Implement merging in reverse in one step
Michael Tremer [Fri, 20 Nov 2020 16:42:55 +0000 (16:42 +0000)] 
network-list: Implement merging in reverse in one step

This will save us some time because we do not need to
change the list in place first and then merge it.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Flatten out code due to compiler errors
Michael Tremer [Fri, 20 Nov 2020 16:25:56 +0000 (16:25 +0000)] 
database: Flatten out code due to compiler errors

It looks like GCC could not follow the code as it was
written. Therefore I clean up more often now instead
of having a GOTO block where I do that in.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Remove debugging output
Michael Tremer [Fri, 20 Nov 2020 16:25:27 +0000 (16:25 +0000)] 
network: Remove debugging output

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Fix loc_network_is_subnet()
Michael Tremer [Fri, 20 Nov 2020 16:24:40 +0000 (16:24 +0000)] 
network: Fix loc_network_is_subnet()

This function always returned false.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agotest: Add tests to network-lists
Michael Tremer [Fri, 20 Nov 2020 14:43:31 +0000 (14:43 +0000)] 
test: Add tests to network-lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Disable some useless code when not running in debug mode
Michael Tremer [Thu, 19 Nov 2020 12:48:46 +0000 (12:48 +0000)] 
database: Disable some useless code when not running in debug mode

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoexport: Speed-up export in xt_geoip format
Michael Tremer [Thu, 19 Nov 2020 12:41:19 +0000 (12:41 +0000)] 
export: Speed-up export in xt_geoip format

Removing the loop avoids creating a tuple and then iterating over it

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoexport: Remove old flattening feature
Michael Tremer [Thu, 19 Nov 2020 12:40:01 +0000 (12:40 +0000)] 
export: Remove old flattening feature

The database enumerator now only returns networks that will
never overlap.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: Add property to return IP addresses as bytes
Michael Tremer [Thu, 19 Nov 2020 12:34:11 +0000 (12:34 +0000)] 
python: Add property to return IP addresses as bytes

This avoids calling inet_pton to parse IP addresses from string

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: Fix download of database
Michael Tremer [Thu, 19 Nov 2020 12:03:33 +0000 (12:03 +0000)] 
python: Fix download of database

This was all messed up in 0c74f6b1a3bdce5ebdc2ee452b9baf3e421dd3d1
when the change of type for the timestamp wasn't changed everywhere
else.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation: End lookup after an invalid IP address was passed
Michael Tremer [Wed, 18 Nov 2020 13:34:50 +0000 (13:34 +0000)] 
location: End lookup after an invalid IP address was passed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: Remove unnecessary db object from writers
Michael Tremer [Wed, 18 Nov 2020 13:33:45 +0000 (13:33 +0000)] 
python: Remove unnecessary db object from writers

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoexport: Remove filtering for flags
Michael Tremer [Wed, 18 Nov 2020 13:19:04 +0000 (13:19 +0000)] 
export: Remove filtering for flags

The filter is an AND filter and if we set the flags from
the special country codes, we won't get back much.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Add debug output to filtering
Michael Tremer [Wed, 18 Nov 2020 13:18:52 +0000 (13:18 +0000)] 
database: Add debug output to filtering

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Free filter lists in enumerator
Michael Tremer [Tue, 17 Nov 2020 19:01:04 +0000 (19:01 +0000)] 
database: Free filter lists in enumerator

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Do not clean up python list
Michael Tremer [Tue, 17 Nov 2020 18:34:51 +0000 (18:34 +0000)] 
database: Do not clean up python list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoActually clear all lists
Michael Tremer [Tue, 17 Nov 2020 18:14:15 +0000 (18:14 +0000)] 
Actually clear all lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoexport: Change back to use Network objects
Michael Tremer [Tue, 17 Nov 2020 18:13:49 +0000 (18:13 +0000)] 
export: Change back to use Network objects

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoas: Make lists grow dynamically
Michael Tremer [Tue, 17 Nov 2020 17:57:55 +0000 (17:57 +0000)] 
as: Make lists grow dynamically

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Make list grow dynamically
Michael Tremer [Tue, 17 Nov 2020 17:55:51 +0000 (17:55 +0000)] 
networks: Make list grow dynamically

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agocountries: Make list grow dynamically
Michael Tremer [Tue, 17 Nov 2020 17:50:17 +0000 (17:50 +0000)] 
countries: Make list grow dynamically

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Simplify AS matching code
Michael Tremer [Tue, 17 Nov 2020 16:58:55 +0000 (16:58 +0000)] 
database: Simplify AS matching code

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Simplify network matching code
Michael Tremer [Tue, 17 Nov 2020 16:56:43 +0000 (16:56 +0000)] 
database: Simplify network matching code

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoas: Add list for easier processing
Michael Tremer [Tue, 17 Nov 2020 16:46:48 +0000 (16:46 +0000)] 
as: Add list for easier processing

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Filter flags in C
Michael Tremer [Mon, 16 Nov 2020 15:25:15 +0000 (15:25 +0000)] 
database: Filter flags in C

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: Only return country codes we want
Michael Tremer [Mon, 16 Nov 2020 15:20:50 +0000 (15:20 +0000)] 
python: Only return country codes we want

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoImplement filtering for multiple countries in the enumerator
Michael Tremer [Mon, 16 Nov 2020 15:13:28 +0000 (15:13 +0000)] 
Implement filtering for multiple countries in the enumerator

This will allow us to speed up the export of the database
if only a few countries should be returned.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoMove network lists into an own file
Michael Tremer [Sun, 15 Nov 2020 15:02:28 +0000 (15:02 +0000)] 
Move network lists into an own file

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: Move tree flattening into C
Michael Tremer [Fri, 13 Nov 2020 12:09:03 +0000 (12:09 +0000)] 
python: Move tree flattening into C

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Unexport all tree functions
Michael Tremer [Fri, 13 Nov 2020 11:43:53 +0000 (11:43 +0000)] 
network: Unexport all tree functions

These should not be exported

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Add function to pop first element from stack
Michael Tremer [Fri, 13 Nov 2020 11:38:15 +0000 (11:38 +0000)] 
network: Add function to pop first element from stack

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Sort result of excluded lists
Michael Tremer [Fri, 13 Nov 2020 11:29:15 +0000 (11:29 +0000)] 
network: Sort result of excluded lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Filter results coming from stack
Michael Tremer [Fri, 13 Nov 2020 11:29:02 +0000 (11:29 +0000)] 
database: Filter results coming from stack

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Move network filtering into a separate function
Michael Tremer [Fri, 13 Nov 2020 11:23:33 +0000 (11:23 +0000)] 
database: Move network filtering into a separate function

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Copy all attributes when splitting networks
Michael Tremer [Thu, 12 Nov 2020 20:09:37 +0000 (20:09 +0000)] 
networks: Copy all attributes when splitting networks

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agotest: Update API
Michael Tremer [Thu, 12 Nov 2020 20:09:20 +0000 (20:09 +0000)] 
test: Update API

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Add option to return networks flattened
Michael Tremer [Thu, 12 Nov 2020 20:02:03 +0000 (20:02 +0000)] 
database: Add option to return networks flattened

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Add function to exclude multiple networks at once
Michael Tremer [Thu, 12 Nov 2020 20:01:17 +0000 (20:01 +0000)] 
network: Add function to exclude multiple networks at once

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Add new subnet function
Michael Tremer [Thu, 12 Nov 2020 20:00:09 +0000 (20:00 +0000)] 
network: Add new subnet function

The old one is too difficult to use in terms of order
of input parameters and return value.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Add more debugging output to stacks
Michael Tremer [Thu, 12 Nov 2020 19:59:22 +0000 (19:59 +0000)] 
network: Add more debugging output to stacks

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: Export networks exclude function
Michael Tremer [Thu, 12 Nov 2020 19:36:38 +0000 (19:36 +0000)] 
python: Export networks exclude function

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Reduce debugging output
Michael Tremer [Thu, 12 Nov 2020 19:21:58 +0000 (19:21 +0000)] 
network: Reduce debugging output

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Pass flag to enumerator to flatten output
Michael Tremer [Thu, 12 Nov 2020 19:21:13 +0000 (19:21 +0000)] 
database: Pass flag to enumerator to flatten output

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Make lists unique
Michael Tremer [Thu, 12 Nov 2020 14:35:43 +0000 (14:35 +0000)] 
network: Make lists unique

Networks that are in the list won't be added again

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Add function to merge two lists
Michael Tremer [Thu, 12 Nov 2020 14:33:22 +0000 (14:33 +0000)] 
networks: Add function to merge two lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Add function to check if network is part of a list
Michael Tremer [Thu, 12 Nov 2020 14:28:15 +0000 (14:28 +0000)] 
networks: Add function to check if network is part of a list

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Add function to check if two networks overlap
Michael Tremer [Thu, 12 Nov 2020 14:24:58 +0000 (14:24 +0000)] 
networks: Add function to check if two networks overlap

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetwork: Add functions to break network into subnets
Michael Tremer [Thu, 12 Nov 2020 14:18:40 +0000 (14:18 +0000)] 
network: Add functions to break network into subnets

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Add function to dump lists
Michael Tremer [Thu, 12 Nov 2020 13:57:35 +0000 (13:57 +0000)] 
networks: Add function to dump lists

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agonetworks: Add list to manage groups of networks
Michael Tremer [Wed, 11 Nov 2020 23:01:19 +0000 (23:01 +0000)] 
networks: Add list to manage groups of networks

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agotest: Add tests for database enumerator
Michael Tremer [Wed, 11 Nov 2020 21:16:45 +0000 (21:16 +0000)] 
test: Add tests for database enumerator

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-importer.in: always convert organisation handles into upper cases
Peter Müller [Tue, 3 Nov 2020 15:31:08 +0000 (15:31 +0000)] 
location-importer.in: always convert organisation handles into upper cases

Fixes: #12523

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation.in: do not confuse UTC with local time zones
Peter Müller [Thu, 29 Oct 2020 14:36:46 +0000 (07:36 -0700)] 
location.in: do not confuse UTC with local time zones

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
3 months agolocation update: Remove double conversion of timestamps
Peter Müller [Thu, 29 Oct 2020 14:25:53 +0000 (07:25 -0700)] 
location update: Remove double conversion of timestamps

This caused that the timestamp in DNS was misinterpreted
as local time and often, databases could not be downloaded.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>