lib/wmap/cidr_tracker.rb
# Determine if a CIDR entry is already known
Determine if a CIDR entry is already known
Determine if a CIDR entry is already known
def cidr_known? (cidr)
		puts "Determine if the CIDR is known: #{cidr}" if @verbose
		known=false
		cidr=cidr.strip unless cidr.nil?
		cidr=cidr+"/32" if is_ip?(cidr)
		raise "Invalid CIDR format: #{cidr}" unless is_cidr?(cidr)
		return false if @known_cidr_blks==nil
		return true if @known_cidr_blks.key?(cidr)
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
		return false
	end
def cidr_known? ( cidr ) puts "Determine if the CIDR is known: #{cidr}" if @verbose known = false cidr = cidr . strip unless cidr . nil? cidr = cidr + "/32" if is_ip? ( cidr ) raise "Invalid CIDR format: #{cidr}" unless is_cidr? ( cidr ) return false if @known_cidr_blks == nil return true if @known_cidr_blks . key? ( cidr ) rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return false end
Determine if a CIDR entry is already known
Determine if a CIDR entry is already known
cidr
<not_specific>