metalbond

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoreAlreadySubscribedToVNIError

func IgnoreAlreadySubscribedToVNIError(err error) error

func IgnoreAlreadyUnsubscribedToVNIError

func IgnoreAlreadyUnsubscribedToVNIError(err error) error

func IgnoreNextHopAlreadyExistsError

func IgnoreNextHopAlreadyExistsError(err error) error

func IgnoreNextHopNotFoundError

func IgnoreNextHopNotFoundError(err error) error

func IgnoreNotSubscribedToVNIError

func IgnoreNotSubscribedToVNIError(err error) error

func IsAlreadySubscribedToVNIError

func IsAlreadySubscribedToVNIError(err error) bool

func IsAlreadyUnsubscribedToVNIError

func IsAlreadyUnsubscribedToVNIError(err error) bool

func IsDestinationNotFoundError

func IsDestinationNotFoundError(err error) bool

func IsNextHopAlreadyExistsError

func IsNextHopAlreadyExistsError(err error) bool

func IsNextHopNotFoundError

func IsNextHopNotFoundError(err error) bool

func IsNotSubscribedToVNIError

func IsNotSubscribedToVNIError(err error) bool

func IsVNINotFoundError

func IsVNINotFoundError(err error) bool

Types

type ClientOptions

type ClientOptions struct {
	IPv4Only         bool
	PreferredNetwork *net.IPNet
}

type DefaultRouteOperation

type DefaultRouteOperation int
const (
	AddDefaultRoute DefaultRouteOperation = iota + 1
	RemoveDefaultRoute
)

type DefaultRouterAddress

type DefaultRouterAddress struct {
	RouterAddress    netip.Addr
	PublicVNI        uint32
	SetBySubsciption bool
	RWMutex          sync.RWMutex
}

type Destination

type Destination struct {
	Prefix netip.Prefix
}

type MBRouteUtil

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

func NewMBRouteUtil

func NewMBRouteUtil(mb *metalbond.MetalBond) *MBRouteUtil

func (*MBRouteUtil) AnnounceRoute

func (c *MBRouteUtil) AnnounceRoute(_ context.Context, vni VNI, destination Destination, nextHop NextHop) error

func (*MBRouteUtil) GetRoutesForVni

func (c *MBRouteUtil) GetRoutesForVni(_ context.Context, vni VNI) error

func (*MBRouteUtil) IsSubscribed

func (c *MBRouteUtil) IsSubscribed(_ context.Context, vni VNI) bool

func (*MBRouteUtil) Subscribe

func (c *MBRouteUtil) Subscribe(_ context.Context, vni VNI) error

func (*MBRouteUtil) Unsubscribe

func (c *MBRouteUtil) Unsubscribe(_ context.Context, vni VNI) error

func (*MBRouteUtil) WithdrawRoute

func (c *MBRouteUtil) WithdrawRoute(_ context.Context, vni VNI, destination Destination, nextHop NextHop) error

type MetalnetClient

type MetalnetClient struct {
	DefaultRouterAddress *DefaultRouterAddress
	// contains filtered or unexported fields
}

func NewMetalnetClient

func NewMetalnetClient(log *logr.Logger, dpdkClient dpdkclient.Client, metalnetCache *internal.MetalnetCache, routerAddr *DefaultRouterAddress, opts ClientOptions) *MetalnetClient

func (*MetalnetClient) AddRoute

func (c *MetalnetClient) AddRoute(vni mb.VNI, dest mb.Destination, hop mb.NextHop) error

func (*MetalnetClient) CleanupNotPeeredRoutes

func (c *MetalnetClient) CleanupNotPeeredRoutes(vni uint32) error

func (*MetalnetClient) FilterDefaultRoute

func (c *MetalnetClient) FilterDefaultRoute(operation DefaultRouteOperation, vni mb.VNI, dest mb.Destination, hop mb.NextHop) (bool, error)

func (*MetalnetClient) RemoveRoute

func (c *MetalnetClient) RemoveRoute(vni mb.VNI, dest mb.Destination, hop mb.NextHop) error

func (*MetalnetClient) SetDefaultRouterAddress

func (c *MetalnetClient) SetDefaultRouterAddress(address netip.Addr)

func (*MetalnetClient) SetMetalBond

func (c *MetalnetClient) SetMetalBond(mb *mb.MetalBond)

type NextHop

type NextHop struct {
	TargetAddress    netip.Addr
	TargetVNI        VNI
	TargetHopType    pb.NextHopType
	TargetNATMinPort uint16
	TargetNATMaxPort uint16
}

type RouteUtil

type RouteUtil interface {
	AnnounceRoute(ctx context.Context, vni VNI, destination Destination, nextHop NextHop) error
	WithdrawRoute(ctx context.Context, vni VNI, destination Destination, nextHop NextHop) error
	Subscribe(ctx context.Context, vni VNI) error
	Unsubscribe(ctx context.Context, vni VNI) error
	IsSubscribed(ctx context.Context, vni VNI) bool
	GetRoutesForVni(ctx context.Context, vni VNI) error
}

type VNI

type VNI = metalbond.VNI

Jump to

Keyboard shortcuts

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