mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 13:15:12 +02:00
geoip: use simpler, preprocessed integer vector lists and fix endian issue
The old database format was in unknown byteorder -- if you run the converter program yourself, you got a host order file, but if you downloaded the preprocessed DB file (geoipdb.bin), you got a little-endian file. Use a new database format. Instead of having an index and a DB file, do away with the index and let the filesystem do the indexing, using one file per country. Also access the database files with a known endianess type. The converter script now produces two distinct variants (especially needed for IA-64). All of this reduces the touched code by half.
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
Match a packet by its source or destination country.
|
||||
.TP
|
||||
[\fB!\fR] \fB--src-cc\fR, \fB--source-country \fIcountry\fR[\fB,\fIcountry\fB,\fIcountry\fB,\fI...\fR]
|
||||
[\fB!\fP] \fB--src-cc\fP, \fB--source-country\fP \fIcountry\fP[\fB,\fP\fIcountry\fP\fB...\fP]
|
||||
Match packet coming from (one of) the specified country(ies)
|
||||
.TP
|
||||
[\fB!\fR] \fB--dst-cc\fR, \fB--destination-country \fIcountry\fR[\fB,\fIcountry\fB,\fIcountry\fB,\fI...\fR]
|
||||
[\fB!\fP] \fB--dst-cc\fP, \fB--destination-country\fP \fIcountry\fP[\fB,\fP\fIcountry\fP\fB...\fP]
|
||||
Match packet going to (one of) the specified country(ies)
|
||||
.TP
|
||||
NOTE:
|
||||
The country is inputed by its ISO3166 code.
|
||||
.P
|
||||
The only extra files you need is a binary db (geoipdb.bin) & its index file (geoipdb.idx).
|
||||
Both files are generated from a countries & subnets database with the csv2bin tool,
|
||||
available at http://people.netfilter.org/peejix/geoip/. Both files MUST also be moved in /var/geoip/
|
||||
as the shared library is statically looking for that pathname (ex.: /var/geoip/geoipdb.bin).
|
||||
The extra files you will need is the binary database files. They are generated
|
||||
from a country-subnet database with the geoip_csv_iv0.pl tool, available at
|
||||
http://jengelh.hopto.org/files/geoip/ . The files MUST be moved to /var/geoip/
|
||||
as the shared library is statically looking for this pathname (e.g.
|
||||
/var/geoip/LE/de.iv0).
|
||||
|
Reference in New Issue
Block a user