Documentation ¶
Index ¶
- type Range
- type Subnet
- func NewFromAddrAndBits(addr string, bits int) (subnet *Subnet, err error)
- func NewFromPrefix(prefix string) (subnet *Subnet, err error)
- func NewNamedFromAddrAndBits(addr string, bits int, name string) (subnet *Subnet, err error)
- func NewNamedFromPrefix(prefix string, name string) (subnet *Subnet, err error)
- func (s *Subnet) BinaryID() (mask string)
- func (s *Subnet) BinaryMask() (mask string)
- func (s *Subnet) BroadcastAddr() (ip netip.Addr)
- func (s *Subnet) CIDR() (cidr string)
- func (s *Subnet) Class() (class rune)
- func (s *Subnet) ClassHostBits() int
- func (s *Subnet) ClassNetworkBits() int
- func (s *Subnet) EffectiveNetworks(secondarySubnet *Subnet) int64
- func (s *Subnet) First() (ip netip.Addr, err error)
- func (s *Subnet) Hosts() int64
- func (s *Subnet) IP() netip.Addr
- func (s *Subnet) IPRange() (r Range, err error)
- func (s *Subnet) IPRanges() (ranges []Range, err error)
- func (s *Subnet) IPs() (ips []netip.Addr, err error)
- func (s *Subnet) JSON() (bytes []byte, err error)
- func (s *Subnet) Last() (ip netip.Addr)
- func (s *Subnet) Name() string
- func (s *Subnet) NetworkAddr() (ip netip.Addr)
- func (s *Subnet) Networks() int64
- func (s *Subnet) Prefix() netip.Prefix
- func (s *Subnet) SecondaryIPRanges(secondarySubnet *Subnet) (ranges []Range, err error)
- func (s *Subnet) SecondarySubnets(secondarySubnet *Subnet) (subnets []*Subnet, err error)
- func (s *Subnet) SetName(name string)
- func (s *Subnet) String() string
- func (s *Subnet) SubnetMask() netip.Addr
- func (s *Subnet) Subnets() (subnets []*Subnet, err error)
- func (s *Subnet) TotalHosts() int64
- func (s *Subnet) UsableHosts() int64
- func (s *Subnet) UsableIPRange() (r Range, err error)
- func (s *Subnet) UsableIPs() (ips []netip.Addr, err error)
- func (s *Subnet) WildcardMask() netip.Addr
- func (s *Subnet) YAML() (bytes []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
Range added because ranges were removed when netaddr joined core Go
type Subnet ¶
type Subnet struct {
// contains filtered or unexported fields
}
Subnet an IP subnet
func NewFromAddrAndBits ¶
NewFromAddrAndBits new using incoming prefix ip and network bits
func NewFromPrefix ¶
NewFromPrefix new using incoming prefix
func NewNamedFromAddrAndBits ¶
NewNamedFromAddrAndBits new with name using incoming prefix ip and network bits
func NewNamedFromPrefix ¶
NewNamedFromPrefix new with name using incoming prefix
func (*Subnet) BinaryMask ¶
BinaryMask get dot delimited subnet mask in binary
func (*Subnet) BroadcastAddr ¶
BroadcastAddr get broadcast address for subnet, i.e. the max IP
func (*Subnet) ClassHostBits ¶
ClassHostBits bits used for network in class block
func (*Subnet) ClassNetworkBits ¶
ClassNetworkBits bits not used for hosts in class block
func (*Subnet) EffectiveNetworks ¶
EffectiveNetworks number of networks
func (*Subnet) NetworkAddr ¶
NetworkAddr get last IP for subnet
func (*Subnet) SecondaryIPRanges ¶
SecondaryIPRanges set of ranges in the context of parent subnet
func (*Subnet) SecondarySubnets ¶
SecondarySubnets set of subnets in the context of parent subnet
func (*Subnet) SubnetMask ¶
SubnetMask get subnet mask for subnet
func (*Subnet) UsableHosts ¶
UsableHosts number of usable hosts
func (*Subnet) UsableIPRange ¶
UsableIPRange get range of IPs usable for hosts
func (*Subnet) WildcardMask ¶
WildcardMask get wildcard mask for subnet