Validate the Service Instance address.

It must be the ip address of the node.

@param address
the address.
@return
OK if match the ip pattern.
4430
public static ErrorCode isAddressValid(String address){
        if (!isMustFieldValid( address, ipRegEx)) {
            return ErrorCode.SERVICE_INSTANCE_ADDRESS_FORMAT_ERROR;
        }
        return ErrorCode.OK;
    }
612273
static InetAddress inet4FromInt(int address) {
        byte[] addr = new byte[4];
        addr[0] = (byte) ((address >>> 24) & 0xFF);
        addr[1] = (byte) ((address >>> 16) & 0xFF);
        addr[2] = (byte) ((address >>> 8) & 0xFF);
        addr[3] = (byte) (address & 0xFF);
        try {
            return InetAddress.getByAddress(addr);
        } catch (UnknownHostException uhe) {
            throw new AssertionError("Should not reach here");
        }
    }
681471
public static boolean isValidRoutingMulticast(final InetAddress address)
	{
		return address != null && address.isMulticastAddress()
				&& toLong(address) >= toLong(Discoverer.SYSTEM_SETUP_MULTICAST);
	}
1353123
public boolean isMatch(String address)
  {
    try {
      return isMatch(InetAddress.getByName(address));
    } catch (Exception e) {
      log.log(Level.FINER, e.toString(), e);

      return false;
    }
  }
517820
public static InetAddress parse(final String ip)
	{
		if (ip == null || ip.isEmpty())
			throw new IllegalArgumentException("A null or empty string is not a valid IP address!");

		try
		{
			return InetAddress.getByName(ip);
		}
		catch (Throwable t)
		{
			throw new IllegalArgumentException("Not a valid IP address: " + ip, t);
		}
	}
1309250
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString response_validator = new MPSString();
		response_validator.validate(operationType, response, "\"response\"");
		
		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
	}
538198
private static void checkAddress(String address, AddressFamily addrFamily) {
        if (addrFamily == null) {
            throw new NullPointerException("addrFamily");
        }

        switch (addrFamily) {
            case AF_UNSPEC:
                if (address != null) {
                    throw new HAProxyProtocolException("unable to validate an AF_UNSPEC address: " + address);
                }
                return;
            case AF_UNIX:
                return;
        }

        if (address == null) {
            throw new NullPointerException("address");
        }

        switch (addrFamily) {
            case AF_IPv4:
                if (!NetUtil.isValidIpV4Address(address)) {
                    throw new HAProxyProtocolException("invalid IPv4 address: " + address);
                }
                break;
            case AF_IPv6:
                if (!NetUtil.isValidIpV6Address(address)) {
                    throw new HAProxyProtocolException("invalid IPv6 address: " + address);
                }
                break;
            default:
                throw new Error();
        }
    }
299162
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
	}
293816
public static Predicate<InetAddress> ofExact(String address) {
        requireNonNull(address, "address");
        try {
            final InetAddress inetAddress = InetAddress.getByName(address);
            return ofExact(inetAddress);
        } catch (UnknownHostException e) {
            throw new IllegalArgumentException("Invalid address: " + address, e);
        }
    }
786700
public static boolean isValidIPAddress(String networkAddress) {
		if (networkAddress != null) {
			String[] split = networkAddress.split("\\.");
			if (split.length == 4) {
				int[] octets = new int[4];
				for (int i=0; i<4; i++) {
					try {
						octets[i] = Integer.parseInt(split[i]);
					} catch (NumberFormatException e) {
						return false;
					}
					if (octets[i] < 0 || octets[i] > 255) {
						return false;
					}
				}
				return true;
			}
		}
		return false;
	}
383959
def validate(self, ip, **kwargs):
        """"""
        
        if ip is None:
            return False

        ip = stringify(ip)

        if self.IPV4_REGEX.match(ip):

            try:
                socket.inet_pton(socket.AF_INET, ip)
                return True
            except AttributeError:  # no inet_pton here, sorry
                try:
                    socket.inet_aton(ip)
                except socket.error:
                    return False
                return ip.count('.') == 3
            except socket.error:  # not a valid address
                return False

        if self.IPV6_REGEX.match(ip):
            try:
                socket.inet_pton(socket.AF_INET6, ip)
            except socket.error:  # not a valid address
                return False
            return True
732549
public static function validate(string $address, $network = null): bool
    {
        try {
            $addressCreator = new AddressCreator();
            $addressCreator->fromString($address, $network);

            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
1127810
public GeoLocationResponse addAddress(final String address) {
        if (StringUtils.isNotBlank(address)) {
            this.addresses.add(address);
        }
        return this;
    }
281443
@Override
	public boolean validateObject(InetSocketAddress address, Socket socket) {
		if (socket == null) {
			log.error("Socket is null [{}]", address);
			return false;
		}

		if (!socket.isBound()) {
			log.error("Socket is not bound [{}]", address);
			return false;
		}
		if (socket.isClosed()) {
			log.error("Socket is closed [{}]", address);
			return false;
		}
		if (!socket.isConnected()) {
			log.error("Socket is not connected [{}]", address);
			return false;
		}
		if (socket.isInputShutdown()) {
			log.error("Socket input is shutdown [{}]", address);
			return false;
		}
		if (socket.isOutputShutdown()) {
			log.error("Socket output is shutdown [{}]", address);
			return false;
		}
		return true;
	}
999803
public void setAddress(final String address) {
		if (this.address == null && address != null && address.contains("@")) {
			this.address = address;
		}
	}
937062
private boolean isIPAddress(@Nonnull String address) {
        return (InetAddressUtils.isIPv4Address(address) || InetAddressUtils.isIPv6Address(address));
    }
1245736
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSInternetHost ip_address_validator = new MPSInternetHost();
		ip_address_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);
		ip_address_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		ip_address_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		ip_address_validator.validate(operationType, ip_address, "\"ip_address\"");
		
		MPSString community_validator = new MPSString();
		community_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,"[ a-zA-Z0-9_#.:@=-]+");
		community_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		community_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		community_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		community_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		community_validator.validate(operationType, community, "\"community\"");
		
	}