+sub _touch
+{
+ my $fn = shift;
+ my $now = time;
+ local (*TMP);
+ utime ($now, $now, $fn) || open (TMP, ">>$fn") || LogDbg('err', "DXCIDR::touch: Couldn't touch $fn: $!");
+}
+
+sub reload
+{
+ new();
+
+ my $count = 0;
+ my $files = 0;
+
+ LogDbg('DXProt', "DXCIDR::reload reload database" );
+
+ my $dir;
+ opendir($dir, $main::local_data);
+ while (my $fn = readdir $dir) {
+ next unless my ($suffix) = $fn =~ /^badip\.(\w+)$/;
+ my $c = _load($suffix);
+ LogDbg('DXProt', "DXCIDR::reload: $fn read containing $c ip addresses" );
+ $count += $c;
+ $files++;
+ }
+ closedir $dir;
+
+ LogDbg('DXProt', "DXCIDR::reload $count ip addresses found (IPV4: $count4 IPV6: $count6) in $files badip files" );