Class IpSubnetFilterRule.Ip6SubnetFilterRule
java.lang.Object
io.netty.handler.ipfilter.IpSubnetFilterRule.Ip6SubnetFilterRule
- All Implemented Interfaces:
IpFilterRule
- Enclosing class:
IpSubnetFilterRule
static final class IpSubnetFilterRule.Ip6SubnetFilterRule
extends java.lang.Object
implements IpFilterRule
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final java.math.BigIntegerprivate final java.math.BigIntegerprivate final IpFilterRuleTypeprivate final java.math.BigInteger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateIp6SubnetFilterRule(java.net.Inet6Address ipAddress, int cidrPrefix, IpFilterRuleType ruleType) -
Method Summary
Modifier and TypeMethodDescriptionprivate static java.math.BigIntegeripToInt(java.net.Inet6Address ipAddress) booleanmatches(java.net.InetSocketAddress remoteAddress) private static java.math.BigIntegerprefixToSubnetMask(int cidrPrefix) ruleType()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
MINUS_ONE
private static final java.math.BigInteger MINUS_ONE -
networkAddress
private final java.math.BigInteger networkAddress -
subnetMask
private final java.math.BigInteger subnetMask -
ruleType
-
-
Constructor Details
-
Ip6SubnetFilterRule
private Ip6SubnetFilterRule(java.net.Inet6Address ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
-
-
Method Details
-
matches
public boolean matches(java.net.InetSocketAddress remoteAddress) - Specified by:
matchesin interfaceIpFilterRule- Returns:
- This method should return true if remoteAddress is valid according to your criteria. False otherwise.
-
ruleType
- Specified by:
ruleTypein interfaceIpFilterRule- Returns:
- This method should return
IpFilterRuleType.ACCEPTif allIpFilterRule.matches(InetSocketAddress)for whichIpFilterRule.matches(InetSocketAddress)returns true should the accepted. If you want to exclude all of those IP addresses thenIpFilterRuleType.REJECTshould be returned.
-
ipToInt
private static java.math.BigInteger ipToInt(java.net.Inet6Address ipAddress) -
prefixToSubnetMask
private static java.math.BigInteger prefixToSubnetMask(int cidrPrefix)
-