Fugue.NetAddr.Cidr

Module Members

fromString

(Function)

Type Signature

 fun (String) -> Optional<Cidr>
Argument: cidr
Type: String
Returns:
Type: Optional<Cidr>

include

(Function)

Type Signature

 fun (IpAddress, Cidr) -> Bool
Argument: addr
Type: IpAddress
Argument: network
Type: Cidr
Returns:
Type: Bool

listIps

(Function)

List all the IPs in a CIDR block, or a limitted subset of those.

Example:

# Assuming `cidr` is "192.168.1.0/30".
listIps{network: cidr, limit: 2}  # => ["192.168.1.0", "192.168.1.1"]

Type Signature

 fun { network: Cidr,
       limit: Optional<Int> } -> List<IpAddress>
Argument: network

Network to list the IPs in

Type: Cidr

Argument: limit

Return at most N results

Type: Optional<Int>

Returns:

List of the requested IPs

Type: List<IpAddress>

toString

(Function)

Type Signature

 fun (Cidr) -> String
Argument: cidr
Type: Cidr
Returns:
Type: String

Cidr

(Type)

type Cidr:
  network: IpAddress
  mask: Int

Record {

Field: network
Type: IpAddress
Field: mask
Type: Int

}