lib/wmap/utils/utils.rb
# Convert a CIDR to a list of IPs:  Input is a CIDR expression such as '192.168.1.1/30', output is an array of IPs
Convert a CIDR to a list of IPs:  Input is a CIDR expression such as '192.168.1.1/30', output is an array of IPs
Convert a CIDR to a list of IPs : Input is a CIDR expression such as ' 192 . 168 . 1 . 1 / 30 ' output is an array of IPs
def cidr_2_ips (cidr)
		puts "Method to convert a CIDR block into a list of IPs: #{cidr}" if @verbose
		begin
			cidr4 = NetAddr::CIDR.create(cidr)
			ips = cidr4.enumerate(:Limit => 0, :Bitstep => 1)
			return ips
		rescue => ee
			puts "Exception on method #{__method__}: #{ee}" if @verbose
			return nil
		end
	end
def cidr_2_ips ( cidr ) puts "Method to convert a CIDR block into a list of IPs: #{cidr}" if @verbose begin cidr4 = NetAddr :: CIDR . create ( cidr ) ips = cidr4 . enumerate ( :Limit => 0 , :Bitstep => 1 ) return ips rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return nil end end
Convert a CIDR to a list of IPs:  Input is a CIDR expression such as '192.168.1.1/30', output is an array of IPs
Convert a CIDR to a list of IPs : Input is a CIDR expression such as ' 192 . 168 . 1 . 1 / 30 ' output is an array of IPs
#ips2 = ips.slice!(1, (ips.length-2))
cidr
<not_specific>