Package io.netty.handler.ipfilter
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
Fields Modifier and Type Field Description private static java.math.BigInteger
MINUS_ONE
private java.math.BigInteger
networkAddress
private IpFilterRuleType
ruleType
private java.math.BigInteger
subnetMask
-
Constructor Summary
Constructors Modifier Constructor Description private
Ip6SubnetFilterRule(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.BigInteger
ipToInt(java.net.Inet6Address ipAddress)
boolean
matches(java.net.InetSocketAddress remoteAddress)
private static java.math.BigInteger
prefixToSubnetMask(int cidrPrefix)
IpFilterRuleType
ruleType()
-
-
-
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:
matches
in interfaceIpFilterRule
- Returns:
- This method should return true if remoteAddress is valid according to your criteria. False otherwise.
-
ruleType
public IpFilterRuleType ruleType()
- Specified by:
ruleType
in interfaceIpFilterRule
- Returns:
- This method should return
IpFilterRuleType.ACCEPT
if allIpFilterRule.matches(InetSocketAddress)
for whichIpFilterRule.matches(InetSocketAddress)
returns true should the accepted. If you want to exclude all of those IP addresses thenIpFilterRuleType.REJECT
should be returned.
-
ipToInt
private static java.math.BigInteger ipToInt(java.net.Inet6Address ipAddress)
-
prefixToSubnetMask
private static java.math.BigInteger prefixToSubnetMask(int cidrPrefix)
-
-