Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Asn

Represents an Autonomous System Number. Which is a number that is used to identify a group of IP addresses with a common, clearly defined routing policy.

see

https://en.wikipedia.org/wiki/Autonomous_system_(Internet)

see

https://tools.ietf.org/html/rfc5396

Hierarchy

Index

Constructors

constructor

  • new Asn(rawValue: string | number): Asn
  • Constructor for an instance of ASN

    Parameters

    • rawValue: string | number

      value to construct an ASN from. The given value can either be numeric or string. If in string then it can be in asplain, asdot or asdot+ string representation format

    Returns Asn

Properties

bitSize

bitSize: number = 32

The number of bits needed to represents the value of the ASN number

maximumBitSize

maximumBitSize: BigInteger = Validator.THIRTY_TWO_BIT_SIZE

The maximum bit size (i.e. binary value) of the ASN number in BigInteger

type

type: IPNumType = IPNumType.ASN

value

value: BigInteger

The decimal value represented by the ASN number in BigInteger

Static Private AS_PREFIX

AS_PREFIX: string = "AS"

Methods

getValue

  • getValue(): BigInteger
  • Gets the numeric value of an IP number as {@link BigInteger}

    Returns BigInteger

    the numeric value of an IP number.

hasNext

  • hasNext(): boolean
  • Checks if an IP number has a value greater than the present value

    Returns boolean

    true, if there is a value greater than the present value. Returns false otherwise.

hasPrevious

  • hasPrevious(): boolean
  • Checks if an IP number has a value lesser than the present value

    Returns boolean

    true, if there is a value lesser than the present value. Returns false otherwise.

is16Bit

  • is16Bit(): boolean
  • Checks if the ASN value is 16bit

    Returns boolean

    true if the ASN is a 16bit value. False otherwise.

is32Bit

  • is32Bit(): boolean
  • Checks if the ASN value is 32bit

    Returns boolean

    true if the ASN is a 32bit value. False otherwise.

isEquals

  • Checks if the given IP number, is equals to the current IP number

    Parameters

    • anotherIPNum: AbstractIPNum

      the other IP number to compare with

    Returns boolean

    true if the given IP number is equals

isGreaterThan

  • Checks if the given IP number is greater than this current IP number

    Parameters

    • anotherIPNum: AbstractIPNum

      the other IP number to compare with

    Returns boolean

    true if the given IP number is greater than this current one. False otherwise.

isGreaterThanOrEquals

  • Checks if the given IP number is greater than or equals to this current IP number

    Parameters

    • anotherIPNum: AbstractIPNum

      the other IP number to compare with

    Returns boolean

    {boolean} true if the given IP number is greater than or equals to this current one. False otherwise.

isLessThan

  • Checks if the given IP number is lesser than this current IP number

    Parameters

    • anotherIPNum: AbstractIPNum

      the other IP number to compare with

    Returns boolean

    true if the given IP number is less than this current one. False otherwise.

isLessThanOrEquals

  • Checks if the given IP number is less than or equals to this current IP number

    Parameters

    • anotherIPNum: AbstractIPNum

      the other IP number to compare with

    Returns boolean

    true if the given IP number is less than or equals to this current one. False otherwise.

nextIPNumber

Private parseFromDotNotation

  • parseFromDotNotation(rawValue: string): number

previousIPNumber

  • previousIPNumber(): Asn

toASDot

  • toASDot(): string
  • A string representation where the ASN value is represented using the asplain notation if the ASN value is less than 65536 and uses asdot+ notation when the value is greater than 65536.

    For example 65526 will be represented as "65526" while 65546 will be represented as "1.10"

    Returns string

    A string representation of the ASN in either asplain or asdot+ notation depending on whether the numeric value of the ASN number is greater than 65526 or not.

toASDotPlus

  • toASDotPlus(): string
  • A string representation where the ASN value is represented using the asdot+ notation

    Returns string

    A string representation where the ASN value is represented using the asdot+ notation

toASPlain

  • toASPlain(): string
  • A string representation where the ASN numeric value of is represented as a string. For example "65526"

    Returns string

    A string representation where the ASN numeric value of is represented as a string

toBinaryString

  • toBinaryString(): string
  • Converts the ASN value to binary numbers represented with strings

    Returns string

    a binary string representation of the value of the ASN number

toString

  • toString(): string
  • A string representation where the asn value is prefixed by "ASN". For example "AS65526"

    Returns string

    A string representation where the asn value is prefixed by "ASN"

Static fromBinaryString

  • fromBinaryString(binaryString: string): Asn
  • A convenience method for creating an instance of Asn from a binary string

    Parameters

    • binaryString: string

      to create an ASN instance from

    Returns Asn

    the constructed ASN instance

Static fromNumber

  • fromNumber(rawValue: number): Asn
  • A convenience method for creating an instance of Asn from a numeric value

    Parameters

    • rawValue: number

      the asn numeric value

    Returns Asn

    the constructed ASN instance

Static fromString

  • fromString(rawValue: string): Asn
  • A convenience method for creating an instance of Asn from a string

    The given string can be in asplain, asdot or asdot+ representation format. {@see https://tools.ietf.org/html/rfc5396} for more information on the different ASN string representation

    Parameters

    • rawValue: string

      the asn string. In either asplain, asdot or asdot+ format

    Returns Asn

    the constructed ASN instance

Static Private startWithASprefix

  • startWithASprefix(word: string): boolean

Generated using TypeDoc