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 intprivate final IpFilterRuleTypeprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateIp4SubnetFilterRule(Inet4Address ipAddress, int cidrPrefix, IpFilterRuleType ruleType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(InetSocketAddress remoteAddress) private static intprefixToSubnetMask(int cidrPrefix) ruleType()
-
Field Details
-
networkAddress
private final int networkAddress -
subnetMask
private final int subnetMask -
ruleType
-
-
Constructor Details
-
Ip4SubnetFilterRule
-
-
Method Details
-
matches
- 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.
-
prefixToSubnetMask
private static int prefixToSubnetMask(int cidrPrefix)
-