Displaying 1 result from an estimated 1 matches for "netaddress_ip".
2009 Nov 03
0
[PATCH server] suggest ip address for nics/bondings on edit host/vm network forms
...s i == sgatewayi || i == sbcasti || used_addresses.include?(ip)
+ return ip
+ end
+ }
+
+ nil
+ end
+
+ private
+ # internal helper method, get the range of numeric addresses for this
+ # network address
+ def _numeric_range
+ return [] unless network_id != nil
+ netaddress_ip = IPAddr.new(address)
+ netmask_ip = IPAddr.new(netmask)
+ firstaddress = netaddress_ip.to_i + 1
+ lastaddress = netaddress_ip.to_i + (~netmask_ip).to_i - 1
+ (firstaddress...lastaddress+1)
+ end
+
+
end
diff --git a/src/app/models/network.rb b/src/app/models/network.rb
index 22e5...