cilium: Index | Files

package cidr

import ""


Package Files

cidr.go diff.go

type CIDR Uses

type CIDR struct {

CIDR is a network CIDR representation based on net.IPNet

func DiffCIDRLists Uses

func DiffCIDRLists(old, new []*CIDR) (add, remove []*CIDR)

DiffCIDRLists compares an old and new list of CIDRs and returns the list of removed and added CIDRs

func MustParseCIDR Uses

func MustParseCIDR(str string) *CIDR

MustParseCIDR parses the CIDR string using net.ParseCIDR and panics if the CIDR cannot be parsed

func NewCIDR Uses

func NewCIDR(ipnet *net.IPNet) *CIDR

NewCIDR returns a new CIDR using a net.IPNet

func ParseCIDR Uses

func ParseCIDR(str string) (*CIDR, error)

ParseCIDR parses the CIDR string using net.ParseCIDR

func (*CIDR) AvailableIPs Uses

func (n *CIDR) AvailableIPs() int

AvailableIPs returns the number of IPs available in a CIDR

func (*CIDR) DeepCopy Uses

func (n *CIDR) DeepCopy() *CIDR

DeepCopy creates a deep copy of a CIDR

Package cidr imports 3 packages (graph) and is imported by 32 packages. Updated 2020-04-10. Refresh now. Tools for package owners.