Documentation
¶
Index ¶
- Constants
- func AddressCount(prefixes ...string) uint64
- func AddressRange(network *net.IPNet) (net.IP, net.IP)
- func ExtractPrefix(prefixes []string, prefixLen uint32) (string, []string, error)
- func ExtractPrefixes(prefixes []string, requests ...*connectioncontext.ExtraPrefixRequest) (requested []string, remaining []string, err error)
- func IncrementIP(sourceIp net.IP, ipNet *net.IPNet) (net.IP, error)
- func IpToNet(ipAddr net.IP) *net.IPNet
- func MaxCommonPrefixSubnet(s1, s2 *net.IPNet) *net.IPNet
- func ReleasePrefixes(prefixes []string, released ...string) (remaining []string, err error)
- type PrefixPool
Constants ¶
View Source
const ( PrefixesFile = "excluded_prefixes.yaml" NsmConfigDir = "/var/lib/networkservicemesh/config" PrefixesFilePathDefault = NsmConfigDir + "/" + PrefixesFile )
Variables ¶
This section is empty.
Functions ¶
func AddressCount ¶
func AddressRange ¶
* AddressRange returns the first and last addresses in the given CIDR range.
func ExtractPrefix ¶
func ExtractPrefixes ¶
func ExtractPrefixes(prefixes []string, requests ...*connectioncontext.ExtraPrefixRequest) (requested []string, remaining []string, err error)
Types ¶
type PrefixPool ¶
type PrefixPool interface {
/*
Process ExtraPrefixesRequest and provide a list of prefixes for clients to use.
*/
Extract(connectionId string, family connectioncontext.IpFamily_Family, requests ...*connectioncontext.ExtraPrefixRequest) (srcIP *net.IPNet, dstIP *net.IPNet, requested []string, err error)
Release(connectionId string) error
GetConnectionInformation(connectionId string) (string, []string, error)
GetPrefixes() []string
Intersect(prefix string) (bool, error)
ExcludePrefixes(excludedPrefixes []string) ([]string, error)
ReleaseExcludedPrefixes(excludedPrefixes []string) error
}
* All in one interface for managing prefixes.
func NewPrefixPool ¶
func NewPrefixPool(prefixes ...string) (PrefixPool, error)
func NewPrefixPoolReader ¶
func NewPrefixPoolReader(path string) PrefixPool
Click to show internal directories.
Click to hide internal directories.