Hierarchy

  • IP

Constructors

Properties

ip: Uint8Array
v4allrouter: IP = ...
v4allsys: IP = ...
v4bcast: IP = ...
v4zero: IP = ...
v6interfacelocalallnodes: IP = ...
v6linklocalallnodes: IP = ...
v6linklocalallrouters: IP = ...
v6loopback: IP = ...
v6unspecified: IP = ...
v6zero: IP = ...

Accessors

  • get isGlobalUnicast(): boolean
  • reports whether ip is a global unicast address.

    Remarks

    The identification of global unicast addresses uses address type identification as defined in RFC 1122, RFC 4632 and RFC 4291 with the exception of IPv4 directed broadcast addresses. It returns true even if ip is in IPv4 private address space or local IPv6 unicast address space.

    Returns boolean

  • get isInterfaceLocalMulticast(): boolean
  • reports whether ip is an interface-local multicast address.

    Returns boolean

  • get isLinkLocalMulticast(): boolean
  • reports whether ip is a link-local multicast address.

    Returns boolean

  • get isLinkLocalUnicast(): boolean
  • reports whether ip is a link-local unicast address.

    Returns boolean

  • get isLoopback(): boolean
  • reports whether ip is a loopback address.

    Returns boolean

  • get isMulticast(): boolean
  • reports whether ip is a multicast address.

    Returns boolean

  • get isPrivate(): boolean
  • reports whether ip is a private address, according to RFC 1918 (IPv4 addresses) and RFC 4193 (IPv6 addresses).

    Returns boolean

  • get isUnspecified(): boolean
  • reports whether ip is an unspecified address, either the IPv4 address "0.0.0.0" or the IPv6 address "::".

    Returns boolean

Methods

  • returns the default IP mask for the IP address ip.

    Remarks

    Only IPv4 addresses have default masks; DefaultMask returns undefined if ip is not a valid IPv4 address.

    Returns undefined | IPMask

  • reports whether ip and o are the same IP address. An IPv4 address and that same address in IPv6 form are considered to be equal.

    Parameters

    Returns boolean

  • returns the result of masking the IP address ip with mask.

    Parameters

    Returns undefined | IP

  • converts the IP address ip to a 16-byte representation.

    Remarks

    If ip is not an IP address (it is the wrong length), to16 returns undefined.

    Returns undefined | IP

  • converts the IPv4 address ip to a 4-byte representation.

    Remarks

    If ip is not an IPv4 address, To4 returns nil.

    Returns undefined | IP

  • returns the string form of the IP address ip.

    Remarks

    It returns one of 4 forms:

    • "", if ip has length 0
    • dotted decimal ("192.0.2.1"), if ip is an IPv4 or IP4-mapped IPv6 address
    • IPv6 ("2001:db8::1"), if ip is a valid IPv6 address
    • the hexadecimal form of ip, without punctuation, if no other cases apply

    Returns string

  • parses s as an IP address, returning the result.

    Remarks

    The string s can be in IPv4 dotted decimal ("192.0.2.1"), IPv6 ("2001:db8::68"), or IPv4-mapped IPv6 ("::ffff:192.0.2.1") form. If s is not a valid textual representation of an IP address, parse returns nil.

    Parameters

    • s: string

    Returns undefined | IP

  • returns the IP address (in 16-byte form) of the IPv4 address a.b.c.d.

    Parameters

    • a: number
    • b: number
    • c: number
    • d: number

    Returns IP

Generated using TypeDoc