Package io.netty.handler.ipfilter
Class IpSubnetFilterRule.Ip4SubnetFilterRule
java.lang.Object
io.netty.handler.ipfilter.IpSubnetFilterRule.Ip4SubnetFilterRule
- All Implemented Interfaces:
IpFilterRule
- Enclosing class:
IpSubnetFilterRule
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final IpFilterRuleType
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Ip4SubnetFilterRule
(Inet4Address ipAddress, int cidrPrefix, IpFilterRuleType ruleType) -
Method Summary
Modifier and TypeMethodDescriptionboolean
matches
(InetSocketAddress remoteAddress) private static int
prefixToSubnetMask
(int cidrPrefix) ruleType()
-
Field Details
-
networkAddress
private final int networkAddress -
subnetMask
private final int subnetMask -
ruleType
-
-
Constructor Details
-
Ip4SubnetFilterRule
-
-
Method Details
-
matches
- Specified by:
matches
in interfaceIpFilterRule
- Returns:
- This method should return true if remoteAddress is valid according to your criteria. False otherwise.
-
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.
-
prefixToSubnetMask
private static int prefixToSubnetMask(int cidrPrefix)
-