org.apache.mina.filter.firewall
Class Subnet
java.lang.Object
org.apache.mina.filter.firewall.Subnet
public class Subnet
- extends Object
A IP subnet using the CIDR notation. Currently, only IP version 4
address are supported.
- Version:
- $Rev: 636538 $, $Date: 2008-03-12 22:19:27 +0000 (Wed, 12 Mar 2008) $
- Author:
- The Apache MINA Project (dev@mina.apache.org)
Constructor Summary |
Subnet(InetAddress subnet,
int mask)
Creates a subnet from CIDR notation. |
Subnet
public Subnet(InetAddress subnet,
int mask)
- Creates a subnet from CIDR notation. For example, the subnet
192.168.0.0/24 would be created using the
InetAddress
192.168.0.0 and the mask 24.
- Parameters:
subnet
- The InetAddress
of the subnetmask
- The mask
inSubnet
public boolean inSubnet(InetAddress address)
- Checks if the
InetAddress
is within this subnet
- Parameters:
address
- The InetAddress
to check
- Returns:
- True if the address is within this subnet, false otherwise
toString
public String toString()
- Overrides:
toString
in class Object
- See Also:
Object.toString()
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
Copyright © 2004-2010 Apache MINA Project. All Rights Reserved.