/** * Add matchers for the given comma-delimited IP ranges and group. * * @param groupName name of group * @param ipRanges IP ranges */ protected void addMatchers(String groupName, String[] ipRanges) { for (String entry : ipRanges) { try { IPMatcher ipm; if (entry.startsWith("-")) { ipm = new IPMatcher(entry.substring(1)); ipNegativeMatchers.add(ipm); } else { ipm = new IPMatcher(entry); ipMatchers.add(ipm); } ipMatcherGroupNames.put(ipm, groupName); if (log.isDebugEnabled()) { log.debug("Configured " + entry + " for special group " + groupName); } } catch (IPMatcherException ipme) { log.warn("Malformed IP range specified for group " + groupName, ipme); } } }
netmask[2] = (byte) ((fullMask & 0x0000FF00) >>> 8); netmask[3] = (byte) (fullMask & 0x000000FF); ipToBytes(ipPart, network, mustHave4); if (log.isDebugEnabled()) { log.debug("fullMask: " + fullMask); ipToBytes(parts[0], network, true); ipToBytes(parts[1], netmask, true); netmask[i] = -1; int partCount = ipToBytes(ipPart, network, mustHave4); + ipSpec); network = ip4ToIp6(network); netmask = ip4MaskToIp6(netmask); if (log.isDebugEnabled()) { for (int i = 0; i < network.length; i++) {