private static final class IpSubnetFilterRule.Ip4SubnetFilterRule extends java.lang.Object implements IpFilterRule
| Modifier and Type | Field and Description |
|---|---|
private int |
networkAddress |
private IpFilterRuleType |
ruleType |
private int |
subnetMask |
| Modifier | Constructor and Description |
|---|---|
private |
Ip4SubnetFilterRule(java.net.Inet4Address ipAddress,
int cidrPrefix,
IpFilterRuleType ruleType) |
| Modifier and Type | Method and Description |
|---|---|
private static int |
ipToInt(java.net.Inet4Address ipAddress) |
boolean |
matches(java.net.InetSocketAddress remoteAddress) |
private static int |
prefixToSubnetMask(int cidrPrefix) |
IpFilterRuleType |
ruleType() |
private final int networkAddress
private final int subnetMask
private final IpFilterRuleType ruleType
private Ip4SubnetFilterRule(java.net.Inet4Address ipAddress,
int cidrPrefix,
IpFilterRuleType ruleType)
public boolean matches(java.net.InetSocketAddress remoteAddress)
matches in interface IpFilterRulepublic IpFilterRuleType ruleType()
ruleType in interface IpFilterRuleIpFilterRuleType.ACCEPT if all
IpFilterRule.matches(InetSocketAddress) for which IpFilterRule.matches(InetSocketAddress)
returns true should the accepted. If you want to exclude all of those IP addresses then
IpFilterRuleType.REJECT should be returned.private static int ipToInt(java.net.Inet4Address ipAddress)
private static int prefixToSubnetMask(int cidrPrefix)