Get the price of IPv4 options

REST: GET /price/xdsl/options/ipv4/{ipRange}
@param ipRange [required] The range of the IPv4
435084
public OvhPrice xdsl_options_ipv4_ipRange_GET(net.minidev.ovh.api.price.xdsl.options.OvhIpv4Enum ipRange) throws IOException {
		String qPath = "/price/xdsl/options/ipv4/{ipRange}";
		StringBuilder sb = path(qPath, ipRange);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhPrice.class);
	}
410950
public IPRangeNode findRange(IPRangeNode child) {

	for (IPRangeNode c: this.list) {

	    IPRangeNode result = c.findRange(child);

	    if (result != null) return result;
	}

	return null;
    }
457988
public OvhIP serviceName_ips_ip_GET(String serviceName, String ip) throws IOException {
		String qPath = "/xdsl/{serviceName}/ips/{ip}";
		StringBuilder sb = path(qPath, serviceName, ip);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhIP.class);
	}
954346
def _get_ipv4_addrs(self):
        
        addrs = self._get_addrs()
        ipv4addrs = addrs.get(netifaces.AF_INET)
        if not ipv4addrs:
            return {}
        return ipv4addrs[0]
361137
def _get_ip_range(self):
        
        ip = self._get_real_ip()
        try:
            geobase_entry = IpRange.objects.by_ip(ip)
        except IpRange.DoesNotExist:
            geobase_entry = None
        return geobase_entry
1209336
function getAddress(loopback, opt_family) {
  var family = opt_family || 'IPv4';
  var addresses = [];

  var interfaces;
  if (loopback) {
    var lo = getLoInterface();
    interfaces = lo ? [lo] : null;
  }
  interfaces = interfaces || os.networkInterfaces();
  for (var key in interfaces) {
    interfaces[key].forEach(function(ipAddress) {
      if (ipAddress.family === family &&
          ipAddress.internal === loopback) {
        addresses.push(ipAddress.address);
      }
    });
  }
  return addresses[0];
}
116808
public boolean inRange(InetAddress ip) {
        if (greaterThan(ip, ipHigher))
            return false;
        else if (lessThan(ip, ipLower))
            return false;
        else
            return true;
    }
667501
public OvhBackend serviceName_zone_backends_ipv4_GET(String serviceName, String ipv4) throws IOException {
		String qPath = "/cdn/website/{serviceName}/zone/backends/{ipv4}";
		StringBuilder sb = path(qPath, serviceName, ipv4);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhBackend.class);
	}
893344
public void setIpv6Ranges(java.util.Collection<Ipv6Range> ipv6Ranges) {
        if (ipv6Ranges == null) {
            this.ipv6Ranges = null;
            return;
        }

        this.ipv6Ranges = new com.amazonaws.internal.SdkInternalList<Ipv6Range>(ipv6Ranges);
    }
1066870
public static PactDslRootValue ipAddress() {
    PactDslRootValue value = new PactDslRootValue();
    value.setValue("127.0.0.1");
    value.setMatcher(value.regexp("(\\d{1,3}\\.)+\\d{1,3}"));
    return value;
  }
1342604
public String getConfigurationOptionValue (String optionName, String defaultValue) {
		String optionValue;
		Node configurationOption = this.getConfigurationOption (optionName);
		if (configurationOption != null) {
			optionValue = configurationOption.getTextContent ();
		} else {
			optionValue = defaultValue;
		}
		return optionValue;
	}
349837
public IntegerRanges getRange(String name, String defaultValue) {
		return new IntegerRanges(get(name, defaultValue));
	}
705529
protected boolean ipInRange(String ipAddress, String range) {
        IpAddressMatcher addressMatcher = new IpAddressMatcher(range);
        return addressMatcher.matches(ipAddress);
    }
18222
public static function isInRange(string $range, string $ip) : bool
    {
        if (strpos($range, '/') !== false) {
            // $range is in IP/NETMASK format
            list($range, $netmask) = explode('/', $range, 2);
            if (strpos($netmask, '.') !== false) {
                // $netmask is a 255.255.0.0 format
                $netmask = str_replace('*', '0', $netmask);
                $netmask_dec = ip2long($netmask);

                return (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec);
            } else {
                // $netmask is a CIDR size block
                // fix the range argument
                $x = explode('.', $range);
                while (count($x) < 4) {
                    $x[] = '0';
                }
                list($a, $b, $c, $d) = $x;
                $range = sprintf(
                    '%u.%u.%u.%u',
                    empty($a) ? '0' : $a,
                    empty($b) ? '0' : $b,
                    empty($c) ? '0' : $c,
                    empty($d) ? '0' : $d
                );
                $range_dec = ip2long($range);
                $ip_dec = ip2long($ip);

                // Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s
                //$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));

                // Strategy 2 - Use math to create it
                $wildcard_dec = pow(2, (32 - $netmask)) - 1;
                $netmask_dec = ~$wildcard_dec;

                return ($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec);
            }
        } else {
            // range might be 255.255.*.* or 1.2.3.0-1.2.3.255
            if (strpos($range, '*') !== false) { // a.b.*.* format
                // Just convert to A-B format by setting * to 0 for A and 255 for B
                $lower = str_replace('*', '0', $range);
                $upper = str_replace('*', '255', $range);
                $range = "$lower-$upper";
            }

            if (strpos($range, '-') !== false) { // A-B format
                list($lower, $upper) = explode('-', $range, 2);
                $lower_dec = (float) sprintf('%u', ip2long($lower));
                $upper_dec = (float) sprintf('%u', ip2long($upper));
                $ip_dec = (float) sprintf('%u', ip2long($ip));

                return ($ip_dec >= $lower_dec) && ($ip_dec <= $upper_dec);
            }

            throw new \InvalidArgumentException(
                sprintf("Invalid range '%s', not in format 1.2.3.4/24 or 1.2.3.4/255.255.255.0", $range)
            );
        }
    }
818443
def ipop_range(self, start=0, stop=-1, callback=None, withscores=True):
        ''''''
        backend = self.backend
        res = backend.structure(self).ipop_range(start, stop,
                                                 withscores=withscores)
        if not callback:
            callback = self.load_data if withscores else self.load_values
        return backend.execute(res, callback)
1100915
public boolean belowRange(InetAddress ip) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "belowRange, ip is " + ip);
            Tr.debug(tc, "belowRange, ipLower is " + ipLower);
        }
        return lessThan(ip, ipLower);
    }
586462
def ip_host(value, options=None, version=None):
    '''
    
    '''
    ipaddr_filter_out = _filter_ipaddr(value, options=options, version=version)
    if not ipaddr_filter_out:
        return
    if not isinstance(value, (list, tuple, types.GeneratorType)):
        return six.text_type(ipaddress.ip_interface(ipaddr_filter_out[0]))
    return [six.text_type(ipaddress.ip_interface(ip_a)) for ip_a in ipaddr_filter_out]