Class Cidrs

java.lang.Object
org.elasticsearch.common.network.Cidrs

public final class Cidrs extends Object
  • Method Details

    • cidrMaskToMinMax

      public static long[] cidrMaskToMinMax(String cidr)
      Parses an IPv4 address block in CIDR notation into a pair of longs representing the bottom and top of the address block
      Parameters:
      cidr - an address block in CIDR notation a.b.c.d/n
      Returns:
      array representing the address block
      Throws:
      IllegalArgumentException - if the cidr can not be parsed
    • createCIDR

      public static String createCIDR(long ipAddress, int networkMask)