prefixpool

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package prefixpool provides service for prefix managing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPrefixes

func ExtractPrefixes(prefixes []string, requests ...*networkservice.ExtraPrefixRequest) (requested, remaining []string, err error)

ExtractPrefixes extracts prefixes from given requests

Types

type PrefixPool

type PrefixPool struct {
	// contains filtered or unexported fields
}

PrefixPool is a structure that contains information about prefixes

func New

func New(prefixes ...string) (*PrefixPool, error)

New is a PrefixPool constructor

func (*PrefixPool) ExcludePrefixes

func (impl *PrefixPool) ExcludePrefixes(excludedPrefixes []string) (removedPrefixesList []string, retErr error)

ExcludePrefixes excludes prefixes from the pool of available prefixes

func (*PrefixPool) Extract

func (impl *PrefixPool) Extract(connectionID string, family networkservice.IpFamily_Family, requests ...*networkservice.ExtraPrefixRequest) (srcIP, dstIP *net.IPNet, requested []string, err error)

Extract extracts source and destination from the given connection

func (*PrefixPool) ExtractPrefixes added in v1.2.0

func (impl *PrefixPool) ExtractPrefixes(connectionID string, requests ...*networkservice.ExtraPrefixRequest) (requested []string, err error)

ExtractPrefixes extracts requested prefixes

func (*PrefixPool) GetConnectionInformation

func (impl *PrefixPool) GetConnectionInformation(connectionID string) (ipNet string, prefixes []string, err error)

GetConnectionInformation returns information about connection

func (*PrefixPool) GetPrefixes

func (impl *PrefixPool) GetPrefixes() []string

GetPrefixes returns the list of saved prefixes

func (*PrefixPool) Intersect

func (impl *PrefixPool) Intersect(prefix string) (intersection bool, err error)

Intersect returns is there any intersection with existing prefixes

func (*PrefixPool) Release

func (impl *PrefixPool) Release(connectionID string) error

Release releases prefixes from the connection

func (*PrefixPool) ReleaseExcludedPrefixes

func (impl *PrefixPool) ReleaseExcludedPrefixes(excludedPrefixes []string) error

ReleaseExcludedPrefixes releases excluded prefixes back the pool of available ones

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL