Package 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.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description Subnet(InetAddress subnet, int mask)
Creates a subnet from CIDR notation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
boolean
inSubnet(InetAddress address)
Checks if theInetAddress
is within this subnetString
toString()
-
-
-
Constructor Detail
-
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 theInetAddress
192.168.0.0 and the mask 24.- Parameters:
subnet
- TheInetAddress
of the subnetmask
- The mask
-
-
Method Detail
-
inSubnet
public boolean inSubnet(InetAddress address)
Checks if theInetAddress
is within this subnet- Parameters:
address
- TheInetAddress
to check- Returns:
- True if the address is within this subnet, false otherwise
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
-