Commit Graph

24 Commits

Author SHA1 Message Date
Jan Engelhardt
5e19871613 geoip: build tool should not rely on directory name
Fix this:

	GeoLite2-Country-CSV_20180905$ /usr/lib/xtables-addons/xt_geoip_build

	Use of uninitialized value $dir in concatenation (.) or string at
	/usr/lib/xtables-addons/xt_geoip_build line 59.
	Couldn't open list country names

Do not rely on any directory names (they change). Use the current
directory as the default source directory, similar to the older
xt_geoip_build (well, *.csv was passed as arguments).
2018-09-07 15:03:20 +02:00
Philip Prindeville
56fba3ecff geoip: simplify handling table column names
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-04-30 09:41:29 +02:00
Philip Prindeville
9057fb48f3 geoip: add database query tool for use with ipsets
Add a tool for retrieiving the IPv4 or IPv6 (or both!) CIDR ranges
for a given country, which can then be injected into an ipset if
one doesn't want to use (or have available) the xt_geoip extension.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-04-30 09:41:21 +02:00
Philip Prindeville
e19f91ddb4 geoip: update man page for xt_geoip_build
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-04-30 09:40:54 +02:00
Philip Prindeville
256ac1a4f6 geoip: adapt to GeoLite2 database
Requires Net::CIDR::Lite for manipulating CIDR blocks, aggregation, etc.
since database is stored as subnet/mask pairs and may require compaction
into ranges (which can combine adjacent subnets).

We don't use Net::CIDR because it's a clunkier interface.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-04-30 09:40:51 +02:00
Philip Prindeville
b91dbd03c7 geoip: store database in network byte order
This allows a single database to be built and distributed as a
package that is accepted by both big- and little-endian hosts.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-02-19 01:42:29 +01:00
Jan Engelhardt
1b4b4347c5 geoip: apply consistent style to xt_geoip_build 2018-02-12 13:58:18 +01:00
Philip Prindeville
2f37af43c5 geoip: selective endianness catalog generation 2018-02-12 13:56:48 +01:00
Dmitry Smirnov
e1d9825475 scripts: avoid bashism in xt_geoip_dl
xt_geoip_dl is marked to use /bin/sh. As such, avoid bashisms.
2013-06-02 17:29:12 +02:00
Dmitry Smirnov
fe7a30c746 doc: lint man pages (hyphens and spelling)
* hyphen-used-as-minus-sign
* spelling-error-in-manpage
2013-06-02 16:49:12 +02:00
Jan Engelhardt
bcdb7ed4e9 Update my email address
To ... none! Whatever is recent is in the git log.
2012-11-12 19:01:14 +01:00
Jan Engelhardt
7e5a8b0501 geoip: remove outdated instructions in xt_geoip_build
The manpage contains the authoritative description of options
currently supported.
2012-07-14 02:17:38 +02:00
Jan Engelhardt
93a17fdde0 geoipdb builder: get rid of some global variables 2011-01-27 03:05:30 +01:00
Jan Engelhardt
80444b0d31 geoipdb builder: separate into functions 2011-01-27 03:02:39 +01:00
Jan Engelhardt
f180c0e5c6 geoipdb tools: IPv6 support 2011-01-27 02:57:00 +01:00
Jan Engelhardt
25bf680ead geoip: put IPv4 geoip data into its own map 2010-12-19 00:48:42 +01:00
Jan Engelhardt
4d547c2bfc geoip: remove -b option, always build both endianesses 2010-12-17 22:47:01 +01:00
Jan Engelhardt
f7c7264a65 geoip: remove %names map 2010-12-17 22:41:08 +01:00
Jan Engelhardt
0f42828fd6 geoip: add manpages to utility programs 2010-12-17 22:29:54 +01:00
Jan Engelhardt
e2da87230a geoip: prefix tools with xt_
This is preferable to have when manpages go into system locations.
2010-12-17 22:08:15 +01:00
Jan Engelhardt
7ab69a17fa geoip: add -D option to geoip_build_dir.pl
This option allows to specify a particular output directory. This help
Makefiles in that they do not need to use cd.
2010-07-24 11:22:37 +02:00
Jan Engelhardt
d2339410b2 geoip: add .gitignore 2010-07-24 11:22:37 +02:00
Jan Engelhardt
649caf61e8 geoip: rename original script to build_db 2010-07-24 11:22:37 +02:00
Jan Engelhardt
922a9be87d geoip: import scripts for building the xt_geoip database 2010-07-24 11:22:33 +02:00