Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IPv6CidrRange

Represents a continuous segment of IPv6 number following the classless inter-domain routing scheme for allocating IP addresses.

see

https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

Hierarchy

  • IPv6CidrRange

Implements

Index

Constructors

constructor

  • Constructor for creating an instance of an IPv6 range.

    The arguments taken by the constructor is inspired by the CIDR notation which basically consists of the IP number and the prefix.

    Parameters

    • ipv6: IPv6
    • cidrPrefix: IPv6Prefix

      the prefix which is a representation of the number of bits used to mask the given IPv6 number in other to create the range

    Returns IPv6CidrRange

Properties

Private bitValue

bitValue: BigInteger = bigInt(128)

Private cidrPrefix

cidrPrefix: IPv6Prefix

the prefix which is a representation of the number of bits used to mask the given IPv6 number in other to create the range

Private internalCounterValue

internalCounterValue: IPv6

Private ipv6

ipv6: IPv6

Methods

__@iterator

  • __@iterator(): IterableIterator<IPv6>

contains

  • Indicates if the given IPv6 range is a subset.

    By a subset range, it means all the values of the given range are contained by this IPv6 range

    Parameters

    Returns boolean

    true if the other Ipv6 range is a subset. False otherwise.

getFirst

getLast

getSize

  • getSize(): BigInteger
  • Gets the size of IPv6 numbers contained within the IPv6 range

    Returns BigInteger

    the amount of IPv6 numbers in the range

inside

  • Indicate if the given range is a container range.

    By container range, it means all the IP number in this current range can be found within the given range.

    Parameters

    Returns boolean

    true if the other Ipv6 range is a container range. False otherwise.

isConsecutive

  • Indicates whether the given IPv6 range is an adjacent range.

    An adjacent range being one where the end of the given range, when incremented by one marks the start of the other range. Or where the start of the given range, when decreased by one, marks the end of the other range

    Parameters

    Returns boolean

    true if the two IPv6 ranges are consecutive, false otherwise

isOverlapping

  • Checks if two IPv6 ranges overlap

    Parameters

    Returns boolean

    true if the ranges overlap, false otherwise

next

  • next(value?: any): IteratorResult<IPv6>
  • next(value?: any): IteratorResult<IPv6>

split

take

  • take(count: number): Array<IPv6>
  • Method that takes IPv6 number from within an IPv6 range, starting from the first IPv6 number

    Parameters

    • count: number

      the amount of IPv6 number to take from the IPv6 range

    Returns Array<IPv6>

    an array of IPv6 number, taken from the IPv6 range

toCidrString

  • toCidrString(): string

toRangeString

  • toRangeString(): string
  • Method that returns the IPv6 range in string notation where the first IPv6 number and last IPv6 number are separated by an hyphen. eg. "2001:db8:0:0:0:0:0:0-2001:db8:0:ffff:ffff:ffff:ffff:ffff"

    Returns string

    the range in [first IPv6 number] - [last IPv6 number] format

Static fromCidr

  • Convenience method for constructing an instance of an IPV6Range from an IP range represented in CIDR notation

    Parameters

    • rangeIncidrNotation: string

      the range of the IPv6 number in CIDR notation

    Returns IPv6CidrRange

    the IPV6Range

Generated using TypeDoc