lib/wmap/cidr_tracker.rb
# Save the current cidr hash table into a file
Save the current cidr hash table into a file
Save the current cidr hash table into a file
def save_cidrs_to_file!(file_cidrs=@cidr_seeds)
		puts "Saving the current cidrs cache table from memory to file: #{file_cidrs} ..." if @verbose
		timestamp=Time.now
		f=File.open(file_cidrs, 'w')
		f.write "# Local cidrs file created by Wmap::CidrTracker.save method at: #{timestamp}\n"
		f.write "Network CIDR, CIDR RIPE Reference Text, CIDR NETNAME\n"
		@known_cidr_blks_asce_index.map do |key|
			ref=get_cidr_ref(key)
			netname=get_cidr_netname(key)
			f.write "#{key},#{ref},#{netname}\n"
		end
		f.close
		puts "CIDR cache table is successfully saved: #{file_cidrs}"
	end
def save_cidrs_to_file! ( file_cidrs = @cidr_seeds ) puts "Saving the current cidrs cache table from memory to file: #{file_cidrs} ..." if @verbose timestamp = Time . now f = File . open ( file_cidrs , 'w' ) f . write "# Local cidrs file created by Wmap::CidrTracker.save method at: #{timestamp}\n" f . write "Network CIDR, CIDR RIPE Reference Text, CIDR NETNAME\n" @known_cidr_blks_asce_index . map do | key | ref = get_cidr_ref ( key ) netname = get_cidr_netname ( key ) f . write "#{key},#{ref},#{netname}\n" end f . close puts "CIDR cache table is successfully saved: #{file_cidrs}" end
Save the current cidr hash table into a file
Save the current cidr hash table into a file
#rescue => ee #	puts "Exception on method #{__method__}: #{ee}" if @verbose
file_cidrs
<not_specific>