class Net::IPNet

Overview

An IPNet represents an IP network

Defined in:

net/ip.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ip, mask) #

[View source]

Instance Method Detail

def contains?(ip : IP) #

reports whether the network includes ip


[View source]
def ip : IP #

[View source]
def mask : IPMask #

network number


[View source]
def network #

network returns the address's network name, "ip+net"


[View source]
def to_s #

to_s returns the CIDR notation of n like "192.0.2.1/24" or "2001:db8::/48" as defined in RFC 4632 and RFC 4291. If the mask is not in the canonical form, it returns the string which consists of an IP address, followed by a slash character and a mask expressed as hexadecimal form with no punctuation like "198.51.100.1/c000ff00".


[View source]