Package io.netty.handler.ipfilter
Class IpSubnetFilterRule.Ip6SubnetFilterRule
- java.lang.Object
-
- io.netty.handler.ipfilter.IpSubnetFilterRule.Ip6SubnetFilterRule
-
- All Implemented Interfaces:
IpFilterRule
- Enclosing class:
- IpSubnetFilterRule
private static final class IpSubnetFilterRule.Ip6SubnetFilterRule extends java.lang.Object implements IpFilterRule
-
-
Field Summary
Fields Modifier and Type Field Description private static java.math.BigIntegerMINUS_ONEprivate java.math.BigIntegernetworkAddressprivate IpFilterRuleTyperuleTypeprivate java.math.BigIntegersubnetMask
-
Constructor Summary
Constructors Modifier Constructor Description privateIp6SubnetFilterRule(java.net.Inet6Address ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.math.BigIntegeripToInt(java.net.Inet6Address ipAddress)booleanmatches(java.net.InetSocketAddress remoteAddress)private static java.math.BigIntegerprefixToSubnetMask(int cidrPrefix)IpFilterRuleTyperuleType()
-
-
-
Field Detail
-
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
private final IpFilterRuleType ruleType
-
-
Constructor Detail
-
Ip6SubnetFilterRule
private Ip6SubnetFilterRule(java.net.Inet6Address ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
-
-
Method Detail
-
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
public IpFilterRuleType 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)
-
-