reservation

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindIndex

func FindIndex(indices IndicesInterface, idx reservation.IndexNumber) (int, error)

FindIndex returns the slice index for the passed IndexNumber.

func SortIndices

func SortIndices(idxs IndicesInterface)

SortIndices sorts these Indices according to their index number modulo 16, e.g. [14, 15, 0, 1].

func ValidateIndices

func ValidateIndices(indices IndicesInterface) error

ValidateIndices checks that the indices follow consecutive index numbers, their expiration times are greater or equal, and no more than three indices per expiration time. Also no more than 16 indices are allowed.

Types

type Capacities

type Capacities interface {
	IngressInterfaces() []uint16
	EgressInterfaces() []uint16
	Capacity(from, to uint16) uint64
	CapacityIngress(ingress uint16) uint64
	CapacityEgress(egress uint16) uint64
}

Capacities describes what a capacity description must offer.

type ColibriPath

type ColibriPath interface {
	Copy() ColibriPath
	// Reverse reverses the contained path.
	Reverse() error
	NumberOfHops() int
	IndexOfCurrentHop() int
	IngressEgressIFIDs() (uint16, uint16)
}

ColibriPath is a path of type COLIBRI. This type will be moved to its right place in slayers once the header has been approved. TODO(juagargi): move the type to slayers.

type IndicesInterface

type IndicesInterface interface {
	Len() int
	GetIndexNumber(i int) reservation.IndexNumber
	GetExpiration(i int) time.Time
	GetAllocBW(i int) reservation.BWCls
	GetToken(i int) *reservation.Token
	Rotate(i int) IndicesInterface
}

type MessageWithPath

type MessageWithPath interface {
	Path() ColibriPath
}

MessageWithPath is used to send messages from the COLIBRI service via the BR.

type RequestMetadata

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

RequestMetadata contains information about the request, such as its forwarding path. This base struct can be used by any request or response packets.

func NewRequestMetadata

func NewRequestMetadata(path ColibriPath) (*RequestMetadata, error)

NewRequestMetadata constructs the base Request type.

func (*RequestMetadata) IsLastAS

func (m *RequestMetadata) IsLastAS() bool

IsLastAS returns true if this hop is the last one (this AS is the destination).

func (*RequestMetadata) Path

func (m *RequestMetadata) Path() ColibriPath

Path returns the ColibriPath in this metadata.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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