func RequestIP(network *net.IPNet, ip *net.IP) (*net.IP, error) {
	lock.Lock()
	defer lock.Unlock()
	key := network.String()
	allocated, ok := allocatedIPs[key]
	if !ok {
		allocated = newAllocatedMap()
		allocatedIPs[key] = allocated
	}

	if ip == nil {
		return allocated.getNextIP(network)
	}
	return allocated.checkIP(network, ip)
}
// RequestIP requests an available ip from the given network.  It
// will return the next available ip if the ip provided is nil.  If the
// ip provided is not nil it will validate that the provided ip is available
// for use or return an error
RequestIP requests an available ip from the given network.  It
will return the next available ip if the ip provided is nil.  If the
ip provided is not nil it will validate that the provided ip is available
for use or return an error
// RequestIP requests an available ip from the given network . It // will return the next available ip if the ip provided is nil . If the // ip provided is not nil it will validate that the provided ip is available // for use or return an error
func RequestIP(network *net.IPNet, ip *net.IP) (*net.IP, error) {
	lock.Lock()
	defer lock.Unlock()
	key := network.String()
	allocated, ok := allocatedIPs[key]
	if !ok {
		allocated = newAllocatedMap()
		allocatedIPs[key] = allocated
	}
	if ip == nil {
		return allocated.getNextIP(network)
	}
	return allocated.checkIP(network, ip)
}
func RequestIP ( network * net . IPNet , ip * net . IP ) ( * net . IP , error ) { lock . Lock ( ) defer lock . Unlock ( ) key := network . String ( ) allocated , ok := allocatedIPs [ key ] if ! ok { allocated = newAllocatedMap ( ) allocatedIPs [ key ] = allocated } if ip == nil { return allocated . getNextIP ( network ) } return allocated . checkIP ( network , ip ) }
RequestIP requests an available ip from the given network.
RequestIP requests an available ip from the given network .