my $help = 0;
my $man = 0;
my $v4 = 1;
-my $v6 = 0;
+my $v6 = 1;
my $parse = 1;
my $v4_zone = "asn.rspamd.com";
my $v6_zone = "asn6.rspamd.com";
"download-asn" => \$download_asn,
"download-bgp" => \$download_bgp,
"4!" => \$v4,
- "6" => \$v6,
+ "6!" => \$v6,
"parse!" => \$parse,
"target=s" => \$download_target,
"zone-v4=s" => \$v4_zone,
my $net = $dd->{'prefix'} . '/' . $dd->{'bits'};
if ( $entry && $entry->{'AS_PATH'} ) {
my $as = $entry->{'AS_PATH'}->[-1];
+ if (ref($as) eq "ARRAY") {
+ $as = @{$as}[0];
+ }
+
if ( !$networks->{$as} ) {
if ( $dd->{'subtype'} == 2 ) {
$networks->{$as} = { nets_v4 => [$net], nets_v6 => [] };
my $as_end = $as_start + int( $elts[4] );
for ( my $as = $as_start ; $as < $as_end ; $as++ ) {
- if ( $networks->{"$as"} ) {
- $networks->{"$as"}->{'country'} = $elts[1];
- $networks->{"$as"}->{'rir'} = $elts[0];
+ my $real_as = $as;
+
+ if (ref($as) eq "ARRAY") {
+ $real_as = @{$as}[0];
+ }
+
+ if ( $networks->{"$real_as"} ) {
+ $networks->{"$real_as"}->{'country'} = $elts[1];
+ $networks->{"$real_as"}->{'rir'} = $elts[0];
}
}
}
Options:
--download-asn Download ASN data from RIR
- --download-bgp Download GeoIP data from Maxmind
+ --download-bgp Download GeoIP data from Maxmind
--target Where to download files (default: current dir)
+ --zone-v4 IPv4 zone (default: asn.rspamd.com)
+ --zone-v6 IPv6 zone (default: asn6.rspamd.com)
+ --file-v4 IPv4 zone file (default: ./asn.zone)
+ --file-v6 IPv6 zone (default: ./asn6.zone)
--help Brief help message
--man Full documentation