Ipv4Address

final class Ipv4Address extends IpAddress

Representation of an IPv4 address that works on both the JVM and Scala.js.

Companion:
object
Source:
Host.scala
class IpAddress
trait Host
trait Ordered[Host]
class Object
trait Matchable
class Any

Value members

Concrete methods

override def fold[A](v4: Ipv4Address => A, v6: Ipv6Address => A): A
Definition Classes
Source:
Host.scala
override def isMulticast: Boolean
Definition Classes
Source:
Host.scala
Definition Classes
Source:
Host.scala

Applies the supplied mask to this address.

Applies the supplied mask to this address.

Example:
scala> ipv4"192.168.29.1".masked(ipv4"255.255.0.0")
res0: Ipv4Address = 192.168.0.0
Source:
Host.scala

Computes the last address in the network identified by applying the supplied mask to this address.

Computes the last address in the network identified by applying the supplied mask to this address.

Example:
scala> ipv4"192.168.29.1".maskedLast(ipv4"255.255.0.0")
res0: Ipv4Address = 192.168.255.255
Source:
Host.scala
override def next: Ipv4Address

Gets the IPv4 address after this address, with overflow from 255.255.255.255 to 0.0.0.0.

Gets the IPv4 address after this address, with overflow from 255.255.255.255 to 0.0.0.0.

Definition Classes
Source:
Host.scala
override def previous: Ipv4Address

Gets the IPv4 address before this address, with underflow from 0.0.0.0 to 255.255.255.255.

Gets the IPv4 address before this address, with underflow from 0.0.0.0 to 255.255.255.255.

Definition Classes
Source:
Host.scala

Converts this V4 address to a compat V6 address, where the first 12 bytes are all zero and the last 4 bytes contain the bytes of this V4 address.

Converts this V4 address to a compat V6 address, where the first 12 bytes are all zero and the last 4 bytes contain the bytes of this V4 address.

Source:
Host.scala

Converts this address to a 32-bit unsigned integer.

Converts this address to a 32-bit unsigned integer.

Source:
Host.scala

Converts this V4 address to a mapped V6 address, where the first 10 bytes are all zero, the next two bytes are ff, and the last 4 bytes contain the bytes of this V4 address.

Converts this V4 address to a mapped V6 address, where the first 10 bytes are all zero, the next two bytes are ff, and the last 4 bytes contain the bytes of this V4 address.

Source:
Host.scala
override def toString: String

Returns the dotted decimal representation of this address.

Returns the dotted decimal representation of this address.

Definition Classes
Any
Source:
Host.scala
override def toUriString: String
Definition Classes
Source:
Host.scala
Definition Classes
Source:
Host.scala

Inherited methods

def /(prefixBits: Int): Cidr[Ipv4Address]

Constructs a Cidr address from this address.

Constructs a Cidr address from this address.

Inherited from:
IpAddress
Source:
Host.scala
def <(that: Host): Boolean
Inherited from:
Ordered
def <=(that: Host): Boolean
Inherited from:
Ordered
def >(that: Host): Boolean
Inherited from:
Ordered
def >=(that: Host): Boolean
Inherited from:
Ordered

Narrows this address to an Ipv4Address if that is the underlying type.

Narrows this address to an Ipv4Address if that is the underlying type.

Inherited from:
IpAddress
Source:
Host.scala

Narrows this address to an Ipv6Address if that is the underlying type.

Narrows this address to an Ipv6Address if that is the underlying type.

Inherited from:
IpAddress
Source:
Host.scala

Converts this address to a multicast address, as long as it is in the multicast address range.

Converts this address to a multicast address, as long as it is in the multicast address range.

Inherited from:
IpAddress
Source:
Host.scala

Converts this address to a source specific multicast address, as long as it is in the source specific multicast address range.

Converts this address to a source specific multicast address, as long as it is in the source specific multicast address range.

Inherited from:
IpAddress
Source:
Host.scala

Like asSourceSpecificMulticast but allows multicast addresses outside the source specific range.

Like asSourceSpecificMulticast but allows multicast addresses outside the source specific range.

Inherited from:
IpAddress
Source:
Host.scala

If this address is an IPv4 mapped IPv6 address, converts to an IPv4 address, otherwise returns this.

If this address is an IPv4 mapped IPv6 address, converts to an IPv4 address, otherwise returns this.

Inherited from:
IpAddress
Source:
Host.scala
def compare(that: Host): Int
Inherited from:
Host
Source:
Host.scala
def compareTo(that: Host): Int
Inherited from:
Ordered
override def equals(other: Any): Boolean
Definition Classes
IpAddress -> Any
Inherited from:
IpAddress
Source:
Host.scala
override def hashCode: Int
Definition Classes
IpAddress -> Any
Inherited from:
IpAddress
Source:
Host.scala

Returns true if this address is a V6 address containing a mapped V4 address.

Returns true if this address is a V6 address containing a mapped V4 address.

Inherited from:
IpAddress
Source:
Host.scala

Returns the number of leading ones in this address. When this address is a netmask, the result can be used to create a CIDR.

Returns the number of leading ones in this address. When this address is a netmask, the result can be used to create a CIDR.

Example:
scala> val address = ipv4"192.168.1.25"
scala> val netmask = ipv4"255.255.0.0"
scala> (address / netmask.prefixBits): Cidr[Ipv4Address]
res0: Cidr[Ipv4Address] = 192.168.1.25/16
Inherited from:
IpAddress
Source:
Host.scala
def resolve[F[_] : Applicative]: F[IpAddress]

Resolves this host to an ip address using the platform DNS resolver.

Resolves this host to an ip address using the platform DNS resolver.

If the host cannot be resolved, the effect fails with a com.comcast.ip4s.UnknownHostException.

Inherited from:
Host
Source:
Host.scala

Resolves this host to all ip addresses known to the platform DNS resolver.

Resolves this host to all ip addresses known to the platform DNS resolver.

If the host cannot be resolved, an empty list is returned.

Inherited from:
Host
Source:
Host.scala

Resolves this host to an ip address using the platform DNS resolver.

Resolves this host to an ip address using the platform DNS resolver.

If the host cannot be resolved, a None is returned.

Inherited from:
Host
Source:
Host.scala

Converts this address to a network order byte array of either 4 or 16 bytes.

Converts this address to a network order byte array of either 4 or 16 bytes.

Inherited from:
IpAddress
Source:
Host.scala
Definition Classes
Ipv4AddressPlatform -> IpAddressPlatform
Inherited from:
Ipv4AddressPlatform (hidden)
Source:
IpAddressPlatform.scala

Returns the version of this address.

Returns the version of this address.

Inherited from:
IpAddress
Source:
Host.scala