ru.bitel.common.inet

## Class IpNet

- java.lang.Object
- - ru.bitel.common.inet.IpNet

- Direct Known Subclasses:
    IpResourceNet

      public class IpNet
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `mask`
    `protected byte[]` | `subnet`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IpNet()`
    `IpNet(byte[] subnet, int mask)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getBroadcast()`
    `static byte[]` | `getBroadcast(byte[] subnet, int mask)` 192.168.1.255
    `byte[]` | `getHostMax()`
    `byte[]` | `getHostMin()`
    `int` | `getMask()`
    `static int` | `getMask(byte[] addrFrom, byte[] addrTo)`
    `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()`
    `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)`
    `java.lang.String` | `toString()`
    `static java.lang.String` | `toString(byte[] addressFrom, byte[] addressTo)` Возвращает строковое представление подсети.
    `static java.lang.String` | `toString(byte[] subnet, int mask)` Возвращает строковое представление подсети.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### subnet

          protected byte[] subnet

    - #### mask

          protected int mask

  - ### Constructor Detail

    - #### IpNet

          public IpNet()

    - #### IpNet

          public IpNet(byte[] subnet,
                       int mask)

  - ### Method Detail

    - #### getSubnet

          public byte[] getSubnet()

    - #### setSubnet

          public void setSubnet(byte[] subnet)

    - #### getMask

          public int getMask()

    - #### setMask

          public void setMask(int mask)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### toString

          public static java.lang.String toString(byte[] subnet,
                                                  int mask)

      Возвращает строковое представление подсети.
      Parameters:
        `subnet` -
        `mask` -
      Returns:

    - #### toString

          public static java.lang.String toString(byte[] addressFrom,
                                                  byte[] addressTo)

      Возвращает строковое представление подсети.
      Parameters:
        `subnet` -
        `mask` -
      Returns:

    - #### maskToInt

          public static int maskToInt(byte[] mask)

    - #### getHostMin

          public byte[] getHostMin()

    - #### getHostMax

          public byte[] getHostMax()

    - #### getBroadcast

          public byte[] getBroadcast()

    - #### getNetmaskWildcard

          public byte[] getNetmaskWildcard()

    - #### getNetmask

          public byte[] getNetmask()

    - #### getMaxIp

          public byte[] getMaxIp()

    - #### getMask

          public static int getMask(byte[] addrFrom,
                                    byte[] addrTo)

    - #### newInstance

          public static IpNet newInstance(byte[] addressFrom,
                                          byte[] addressTo)

      Создание новой подсети из правильного диапазона.
      Parameters:
        `addressFrom` -
        `addressTo` -
      Returns:

    - #### inNet

          public boolean inNet(byte[] address)

    - #### inNet

          public static boolean inNet(byte[] address,
                                      byte[] subnet,
                                      int mask)

    - #### getNetmaskWildcard

          public static byte[] getNetmaskWildcard(int size,
                                                  int mask)

      0.0.0.255
      Parameters:
        `size` -
        `mask` -
      Returns:

    - #### getNetmask

          public static byte[] getNetmask(int size,
                                          int mask)

      255.255.255.0
      Parameters:
        `size` -
        `mask` -
      Returns:

    - #### getBroadcast

          public static byte[] getBroadcast(byte[] subnet,
                                            int mask)

      192.168.1.255
      Parameters:
        `subnet` -
        `mask` -
      Returns: