Commit [07bf41] Maximize Restore History

Merge branch 'geoip'

Jan Engelhardt Jan Engelhardt 2011-02-02

1 2 3 .. 9 > >> (Page 1 of 9)
added geoip/xt_geoip_build
added geoip/xt_geoip_dl.1
added extensions/ACCOUNT/VERSION.txt
removed extensions/ipset
removed extensions/ipset/.gitignore
removed extensions/ipset/Kbuild
removed extensions/ipset/Makefile.am
removed extensions/ipset/Mbuild
removed extensions/ipset/ip_set.c
removed extensions/ipset/ip_set.h
removed extensions/ipset/ip_set_bitmaps.h
removed extensions/ipset/ip_set_compat.h
removed extensions/ipset/ip_set_getport.h
removed extensions/ipset/ip_set_hashes.h
changed doc/changelog.txt
changed extensions/libxt_geoip.c
changed extensions/xt_geoip.c
changed extensions/xt_geoip.h
changed geoip/Makefile.am
changed doc/changelog.txt
changed extensions/ACCOUNT/xt_ACCOUNT.c
copied geoip/geoip_build_db.pl -> geoip/xt_geoip_build.1
copied geoip/geoip_download.sh -> geoip/xt_geoip_dl
geoip/xt_geoip_build Diff Switch to side-by-side view
Loading...
geoip/xt_geoip_dl.1 Diff Switch to side-by-side view
Loading...
extensions/ACCOUNT/VERSION.txt Diff Switch to side-by-side view
Loading...
extensions/ipset
File was removed.
extensions/ipset/.gitignore
File was removed.
extensions/ipset/Kbuild
File was removed.
extensions/ipset/Makefile.am
File was removed.
extensions/ipset/Mbuild
File was removed.
extensions/ipset/ip_set.c
File was removed.
extensions/ipset/ip_set.h
File was removed.
doc/changelog.txt Diff Switch to side-by-side view
Loading...
extensions/libxt_geoip.c Diff Switch to side-by-side view
Loading...
extensions/xt_geoip.c Diff Switch to side-by-side view
Loading...
extensions/xt_geoip.h Diff Switch to side-by-side view
Loading...
geoip/Makefile.am Diff Switch to side-by-side view
Loading...
doc/changelog.txt Diff Switch to side-by-side view
Loading...
extensions/ACCOUNT/xt_ACCOUNT.c Diff Switch to side-by-side view
Loading...
geoip/geoip_build_db.pl to geoip/xt_geoip_build.1
--- a/geoip/geoip_build_db.pl
+++ b/geoip/xt_geoip_build.1
@@ -1,54 +1,35 @@
-#!/usr/bin/perl
-#
-#	Converter for MaxMind CSV database to binary, for xt_geoip
-#	Copyright Š Jan Engelhardt <jengelh@medozas.de>, 2008
-#
-#	Use -b argument to create big-endian tables.
-#
-use Getopt::Long;
-use IO::Handle;
-use Text::CSV_XS; # or trade for Text::CSV
-use strict;
-
-my %country;
-my %names;
-my $csv = Text::CSV_XS->new({binary => 0, eol => $/}); # or Text::CSV
-my $mode = "VV";
-my $target_dir = ".";
-
-&Getopt::Long::Configure(qw(bundling));
-&GetOptions(
-	"D=s" => \$target_dir,
-	"b"   => sub { $mode = "NN"; },
-);
-
-if (!-d $target_dir) {
-	print STDERR "Target directory $target_dir does not exist.\n";
-	exit 1;
-}
-
-while (my $row = $csv->getline(*ARGV)) {
-	if (!defined($country{$row->[4]})) {
-		$country{$row->[4]} = [];
-		$names{$row->[4]} = $row->[5];
-	}
-	my $c = $country{$row->[4]};
-	push(@$c, [$row->[2], $row->[3]]);
-	if ($. % 4096 == 0) {
-		print STDERR "\r\e[2K$. entries";
-	}
-}
-
-print STDERR "\r\e[2K$. entries total\n";
-
-foreach my $iso_code (sort keys %country) {
-	printf "%5u ranges for %s %s\n",
-		scalar(@{$country{$iso_code}}),
-		$iso_code, $names{$iso_code};
-
-	open(my $fh, "> $target_dir/".uc($iso_code).".iv0");
-	foreach my $range (@{$country{$iso_code}}) {
-		print $fh pack($mode, $range->[0], $range->[1]);
-	}
-	close $fh;
-}
+.TH xt_geoip_build 1 "2010-12-17" "xtables-addons" "xtables-addons"
+.SH Name
+.PP
+xt_geoip_build \(em convert GeoIP.csv to packed format for xt_geoip
+.SH Syntax
+.PP
+\fI/usr/libexec/xt_geoip/\fP\fBxt_geoip_build\fP [\fB\-D\fP
+\fItarget_dir\fP] [\fIfile\fP...]
+.SH Description
+.PP
+xt_geoip_build is used to build packed raw representations of the range
+database that the xt_geoip module relies on. Since kernel memory is precious,
+much of the preprocessing is done in userspace by this very building tool. One
+file is produced for each country, so that no more addresses than needed are
+required to be loaded into memory. The ranges in the packed database files are
+also ordered, as xt_geoip relies on this property for its bisection approach to
+work.
+.PP
+Input is processed from the listed files, or if none is given, from stdin.
+.PP
+Since the script is usually installed to the libexec directory of the
+xtables-addons package and this is outside $PATH (on purpose), invoking the
+script requires it to be called with a path.
+.PP Options
+.TP
+\fB\-D\fP \fItarget_dir\fP
+Specify a target directory into which the files are to be put.
+.SH Application
+.PP
+Shell commands to build the databases and put them to where they are expected:
+.PP
+xt_geoip_build -D /usr/share/xt_geoip
+.SH See also
+.PP
+xt_geoip_dl(1)
1 2 3 .. 9 > >> (Page 1 of 9)