The Interface IpFilteringHandler.
The listener interface for receiving ipFilter events.
This Interface defines an Ip Filter Rule.
This Interface defines an IpSet object.
General class that handle Ip Filtering.
Implementation of Filter of IP based on ALLOW and DENY rules.
The Class IpFilterRuleList is a helper class to generate a List of Rules from a string.
This class allows to check if an IP V4 or V6 Address is contained in a subnet.
Ip V4 and Ip V6 filter rule.
This class allows to check if an IP-V4-Address is contained in a subnet.
IpV4 only Filter Rule
Handler that block any new connection if there are already a currently active channel connected with the same InetAddress (IP).
The Class PatternRule represents an IP filter rule using string patterns.
The main goal of this package is to allow to filter connections based on IP rules.
The main interface is
all filters will extend.
Two IP filtering are proposed:
OneIpFilterHandler: This filter proposes to allow only one connection by client's IP Address. I.E. this filter will prevent two connections from the same client based on its IP address.
IpFilterRuleHandler: This filter proposes to allow or block IP range (based on standard notation or on CIDR notation) when the connection is running. It relies on another class like IpV4SubnetFilterRule (IPV4 support only), IpSubnetFilterRule (IPV4 and IPV6 support) or PatternRule (string pattern support) which implements those Ip ranges.
Standard use could be as follow: The accept method must be overridden (of course you can override others).
IpFilterListeneror returns null if no listener has been set.
IpFilterListeneror returns false if no listener has been set.
ChannelPipelinepipeline = ...; IpFilterRuleHandler firewall = new IpFilterRuleHandler(); firewall.addAll(new IpFilterRuleList("+n:localhost, +c:192.168.0.0/27, -n:*")); pipeline.addFirst("firewall", firewall);
Copyright © 2008-2016 The Netty Project. All Rights Reserved.