staticinfo

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: 3 Imported by: 0

Documentation

Overview

Package staticinfo contains the internal representation of the StaticInfoExtension path segment extension, and conversion from and to the corresponding protobuf representation. See also StaticInfoExtension in proto/control_plane/v1/seg_extensions.proto.

Index

Constants

View Source
const (
	LinkTypeDirect = iota
	LinkTypeMultihop
	LinkTypeOpennet
)

Variables

This section is empty.

Functions

func ToPB

FromPB creates the protobuf representation for the staticinfo Extension.

Types

type BandwidthInfo

type BandwidthInfo struct {
	Intra map[common.IFIDType]uint64
	Inter map[common.IFIDType]uint64
}

BandwidthInfo is the internal repesentation of `bandwidth` in the StaticInfoExtension.

type Extension

type Extension struct {
	Latency      LatencyInfo
	Bandwidth    BandwidthInfo
	Geo          GeoInfo
	LinkType     LinkTypeInfo
	InternalHops InternalHopsInfo
	Note         string
}

Extension is the internal repesentation of the StaticInfoExtension path segment extension.

func FromPB

func FromPB(pb *cppb.StaticInfoExtension) *Extension

FromPB creates the staticinfo Extension from the protobuf representation.

type GeoCoordinates

type GeoCoordinates struct {
	Latitude  float32
	Longitude float32
	Address   string
}

GeoCoordinates is the internal repesentation of the GeoCoordinates in the StaticInfoExtension.

type GeoInfo

type GeoInfo map[common.IFIDType]GeoCoordinates

GeoInfo is the internal repesentation of `geo` in the StaticInfoExtension.

type InternalHopsInfo

type InternalHopsInfo map[common.IFIDType]uint32

InternalHopsInfo is the internal representation of `internal_hops` in the StaticInfoExtension.

type LatencyInfo

type LatencyInfo struct {
	Intra map[common.IFIDType]time.Duration
	Inter map[common.IFIDType]time.Duration
}

LatencyInfo is the internal repesentation of `latency` in the StaticInfoExtension.

type LinkType

type LinkType uint8

LinkType is the internal representation of the LinkType in the StaticInfoExtension. There is no UNSPECIFIED value here, as we can simply omit these from the internal map representation.

type LinkTypeInfo

type LinkTypeInfo map[common.IFIDType]LinkType

LinkTypeInfo is the internal representation of `link_type` in the StaticInfoExtension.

Jump to

Keyboard shortcuts

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