def network_segments_for_ip(ip)
      ok_ip = IPAddr.new(ip)
      matches = []
      network_ranges.each { |id, subnet| matches << id if subnet.include?(ok_ip) }
      matches
    end
def network_segments_for_ip(ip)
      ok_ip = IPAddr.new(ip)
      matches = []
      network_ranges.each { |id, subnet| matches << id if subnet.include?(ok_ip) }
      matches
    end
def network_segments
 Find the ids of the network segments that contain a given IP address.

 Even tho IPAddr.include? will take a String or an IPAddr
 I convert the ip to an IPAddr so that an exception will be raised if
 the ip isn't a valid ip.

 @param ip[String, IPAddr] the IP address to locate

 @param refresh[Boolean] should the data be re-queried?

 @return [Array<Integer>] the ids of the NetworkSegments containing the given ip