Lines Matching refs:address

54  * conflict with each other. The system takes several actions to address
299 * Private method to validate address and prefixLength.
301 private void check(InetAddress address, int prefixLength) {
302 if (address.isLoopbackAddress()) {
303 throw new IllegalArgumentException("Bad address");
305 if (address instanceof Inet4Address) {
309 } else if (address instanceof Inet6Address) {
319 * Add a network address to the VPN interface. Both IPv4 and IPv6
320 * addresses are supported. At least one address must be set before
323 * @throws IllegalArgumentException if the address is invalid.
325 public Builder addAddress(InetAddress address, int prefixLength) {
326 check(address, prefixLength);
328 if (address.isAnyLocalAddress()) {
329 throw new IllegalArgumentException("Bad address");
332 mAddresses.append(' ' + address.getHostAddress() + '/' + prefixLength);
337 * Convenience method to add a network address to the VPN interface
338 * using a numeric address string. See {@link InetAddress} for the
339 * definitions of numeric address formats.
341 * @throws IllegalArgumentException if the address is invalid.
344 public Builder addAddress(String address, int prefixLength) {
345 return addAddress(InetAddress.parseNumericAddress(address), prefixLength);
354 public Builder addRoute(InetAddress address, int prefixLength) {
355 check(address, prefixLength);
358 byte[] bytes = address.getAddress();
362 throw new IllegalArgumentException("Bad address");
367 mRoutes.append(String.format(" %s/%d", address.getHostAddress(), prefixLength));
373 * using a numeric address string. See {@link InetAddress} for the
374 * definitions of numeric address formats.
379 public Builder addRoute(String address, int prefixLength) {
380 return addRoute(InetAddress.parseNumericAddress(address), prefixLength);
388 * @throws IllegalArgumentException if the address is invalid.
390 public Builder addDnsServer(InetAddress address) {
391 if (address.isLoopbackAddress() || address.isAnyLocalAddress()) {
392 throw new IllegalArgumentException("Bad address");
397 mConfig.dnsServers.add(address.getHostAddress());
403 * using a numeric address string. See {@link InetAddress} for the
404 * definitions of numeric address formats.
406 * @throws IllegalArgumentException if the address is invalid.
409 public Builder addDnsServer(String address) {
410 return addDnsServer(InetAddress.parseNumericAddress(address));