public final class IpSubnetFilterRule extends java.lang.Object implements IpFilterRule
RuleBasedIpFilter
创建将IP地址分组为子网的规则。
支持IPv4和IPv6。
Constructor and Description |
---|
IpSubnetFilterRule(java.net.InetAddress ipAddress, int cidrPrefix, IpFilterRuleType ruleType) |
IpSubnetFilterRule(java.lang.String ipAddress, int cidrPrefix, IpFilterRuleType ruleType) |
Modifier and Type | Method and Description |
---|---|
boolean |
matches(java.net.InetSocketAddress remoteAddress) |
IpFilterRuleType |
ruleType() |
public IpSubnetFilterRule(java.lang.String ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
public IpSubnetFilterRule(java.net.InetAddress ipAddress, int cidrPrefix, IpFilterRuleType ruleType)
public boolean matches(java.net.InetSocketAddress remoteAddress)
matches
接口
IpFilterRule
public IpFilterRuleType ruleType()
ruleType
在界面
IpFilterRule
IpFilterRuleType.ACCEPT
如果所有IpFilterRule.matches(InetSocketAddress)
为此IpFilterRule.matches(InetSocketAddress)
返回true应该接受的。
如果您想排除所有这些IP地址,则应返回IpFilterRuleType.REJECT
。
Copyright © 2008–2018 The Netty Project. All rights reserved.