public class IpNet
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
mask |
protected byte[] |
subnet |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
byte[] |
getBroadcast() |
static byte[] |
getBroadcast(byte[] subnet,
int mask)
192.168.1.255
|
byte[] |
getHostMax() |
byte[] |
getHostMin() |
int |
getMask() |
static int |
getMask(byte[] addressFrom,
byte[] addressTo) |
byte[] |
getMaxIp() |
byte[] |
getNetmask() |
static byte[] |
getNetmask(int size,
int mask)
255.255.255.0
|
byte[] |
getNetmaskWildcard() |
static byte[] |
getNetmaskWildcard(int size,
int mask)
0.0.0.255
|
byte[] |
getSubnet() |
int |
hashCode() |
boolean |
inNet(byte[] address) |
static boolean |
inNet(byte[] address,
byte[] subnet,
int mask) |
static int |
maskToInt(byte[] mask) |
static IpNet |
newInstance(byte[] addressFrom,
byte[] addressTo)
Создание новой подсети из правильного диапазона.
|
void |
setMask(int mask) |
void |
setSubnet(byte[] subnet) |
static java.lang.String |
toRFCString(byte[] addressFrom,
byte[] addressTo)
Возвращает строковое представление подсети.
|
java.lang.String |
toString() |
static java.lang.String |
toString(byte[] addressFrom,
byte[] addressTo)
Возвращает строковое представление подсети.
|
static java.lang.String |
toString(byte[] subnet,
int mask)
Возвращает строковое представление подсети.
|
public byte[] getSubnet()
public void setSubnet(byte[] subnet)
public int getMask()
public void setMask(int mask)
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toString(byte[] subnet, int mask)
subnet
- mask
- public static java.lang.String toString(byte[] addressFrom, byte[] addressTo)
subnet
- mask
- public static java.lang.String toRFCString(byte[] addressFrom, byte[] addressTo)
subnet
- mask
- public static int maskToInt(byte[] mask)
public byte[] getHostMin()
public byte[] getHostMax()
public byte[] getBroadcast()
public byte[] getNetmaskWildcard()
public byte[] getNetmask()
public byte[] getMaxIp()
public static int getMask(byte[] addressFrom, byte[] addressTo)
public static IpNet newInstance(byte[] addressFrom, byte[] addressTo)
addressFrom
- addressTo
- public boolean inNet(byte[] address)
public static boolean inNet(byte[] address, byte[] subnet, int mask)
public static byte[] getNetmaskWildcard(int size, int mask)
size
- mask
- public static byte[] getNetmask(int size, int mask)
size
- mask
- public static byte[] getBroadcast(byte[] subnet, int mask)
subnet
- mask
- public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object