/usr/lib/geoip/v4-to-v6-layout.pl is in geoip-bin 1.6.12-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #!/usr/bin/perl
use warnings;
use strict;
# Script from Boris Zentner (Maxmind)
# This script converts the IPv4 csv database to the same
# format as the IPv6 database.
sub _x {
sprintf("%02x%02x:%02x%02x", split(/\./, $_[0]));
}
while(<STDIN>){
chomp;
my($f, $t, $tail) = split /,/, $_, 3;
for($t, $f){
s/^"//;
s/"$//;
}
my $xxxxf = _x($f);
my $xxxxt = _x($t);
print <<__OUT__;
"::$f", "::$t", $tail
"::ffff:$f", "::ffff:$t", $tail
"2002:${xxxxf}::", "2002:${xxxxt}:ffff:ffff:ffff:ffff:ffff", $tail
__OUT__
}
exit(0);
|