struct IP::Block::IPv6

Defined in:

ip/block/ipv6.cr

Constructors

Instance Method Summary

Instance methods inherited from struct IP::Block

<(other : IP::Block) <, <=(other : IP::Block) <=, <=>(other : IP::Block) : Int
<=>(other : IP::Address) : Int
<=>
, ==(other : IP::Block) ==, >(other : IP::Block) >, >=(other : IP::Block) >=, address address, adjacent?(other : IP::Address) : Bool
adjacent?(other : IP::Block) : Bool
adjacent?
, block block, covers?(other : IP::Address) : Bool
covers?(other : IP::Block) : Bool
covers?
, each(&block : IP::Address -> Nil) : Nil each, first : IP::Address first, hash(hasher) hash, includes?(other : IP::Address) : Bool includes?, inspect(io : IO) : Nil inspect, intersects?(other : IP::Block) : Bool
intersects?(other : IP::Address) : Bool
intersects?
, ipv4? : Bool ipv4?, ipv6? : Bool ipv6?, last : IP::Address last, mask : IP::Address mask, single_address? : Bool single_address?, size size, to_s(io : IO) : Nil to_s

Constructor methods inherited from struct IP::Block

[](string : String) : self [], []?(string : String) : self? []?, ipv4(string : String) : self ipv4, ipv4?(string : String) : self? ipv4?, ipv6(string : String) : self ipv6, ipv6?(string : String) : self? ipv6?, loopback_ipv4 : self loopback_ipv4, loopback_ipv6 : self loopback_ipv6, new(address : IP::Address, block : Int) : self?
new(string : String) : self
new
, new?(address : IP::Address, block : Int) : self?
new?(string : String) : self?
new?

Constructor Detail

def self.loopback : self #

Constructs a IP::Block:IPv6 representing the IPv6 loopback block.


[View source]
def self.new(address : IP::Address::IPv6, block : Int) : self #

Constructs a new IP::Block::IPv6 from an address and the block size, [0-128].

Raises: MalformedError when the input is malformed.


[View source]
def self.new(string : String) : self #

Constructs a new IP::Block::IPv6 by interpreting the contents of a given String.

Expects a definition in CIDR notation similar to XXXX:XXXX::XXXX:XXXX:XXXX/[0-128], or XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX/[0-128].

Raises: MalformedError when the input is malformed.


[View source]
def self.new?(address : IP::Address::IPv6, block : Int) : self? #

Constructs a new IP::Block::IPv6 from an address and the block size, [0-128].

Returns nil when the input is malformed.


[View source]
def self.new?(string : String) : self? #

Constructs a new IP::Block::IPv6 by interpreting the contents of a given String.

Expects a definition in CIDR notation similar to XXXX:XXXX::XXXX:XXXX:XXXX/[0-128], or XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX/[0-128].

Returns nil when the input is malformed.


[View source]

Instance Method Detail

def address : IP::Address::IPv6 #

Returns the address component of the block which is also the first address.


[View source]
def block : UInt8 #

Returns 'block' size in the form of 2^x, x being the 'size'.


[View source]
def ipv6? : Bool #

Informs if the block is IPv6 or not.


[View source]
def size : UInt128 #

Returns the size of the block in terms of number of addresses.


[View source]