List of utility methods to do IP Address Mash
String | checkIpMask(String ip) check Ip Mask String ipParts[] = ip.split("\\."); if (ipParts.length != 4) return "IP address must have 4 parts"; String message = checkIpMaskPart(ipParts[0]); if (message != null) return message; message = checkIpMaskPart(ipParts[1]); if (message != null) ... |
String | checkIpMaskPart(String part) check Ip Mask Part if ("*".equals(part)) return null; int dash = part.indexOf('-'); try { if (dash == -1) { int value = Integer.parseInt(part); if (value < 0 || value > 255) return "Value out of range in '" + part + "'"; ... |
String | checkIpMaskPart(String part) check Ip Mask Part int dash; if ("*".equals(part)) return null; dash = part.indexOf('-'); if (dash == -1) { int value = Integer.parseInt(part); if (value < 0 || value > 255) return (new StringBuilder()).append("Value out of range in '").append(part).append("'").toString(); ... |