types

package
v0.0.2-pre4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ASSet is the AS Path type used to indicate an AS Set (RFC4271)
	ASSet = 1

	// ASSequence is tha AS Path type used to indicate an AS Sequence (RFC4271)
	ASSequence = 2

	// MaxASNsSegment is the maximum number of ASNs in an AS segment
	MaxASNsSegment = 255
)

ASPath Segment Types

View Source
const (
	// WellKnownCommunityNoExport is the well known no export BGP community (RFC1997)
	WellKnownCommunityNoExport = 0xFFFFFF01
	// WellKnownCommunityNoAdvertise is the well known no advertise BGP community (RFC1997)
	WellKnownCommunityNoAdvertise = 0xFFFFFF02
)

Variables

This section is empty.

Functions

func CommunityStringForUint32

func CommunityStringForUint32(v uint32) string

CommunityStringForUint32 transforms a community into a human readable representation

func ParseCommunityString

func ParseCommunityString(s string) (uint32, error)

ParseCommunityString parses human readable community representation

Types

type ASPath

type ASPath []ASPathSegment

ASPath represents an AS Path (RFC4271)

func ASPathFromProtoASPath

func ASPathFromProtoASPath(segments []*api.ASPathSegment) *ASPath

ASPathFromProtoASPath converts an proto ASPath to ASPath

func (*ASPath) Compare

func (a *ASPath) Compare(b *ASPath) bool

Compare compares two AS Paths

func (ASPath) Length

func (pa ASPath) Length() (ret uint16)

Length returns the AS path length as used by path selection

func (*ASPath) String

func (pa *ASPath) String() (ret string)

String converts an ASPath to it's human redable representation

func (ASPath) ToProto

func (pa ASPath) ToProto() []*api.ASPathSegment

ToProto converts ASPath to proto ASPath

type ASPathSegment

type ASPathSegment struct {
	Type uint8
	ASNs []uint32
}

ASPathSegment represents an AS Path Segment (RFC4271)

func (ASPathSegment) Compare

func (s ASPathSegment) Compare(t ASPathSegment) bool

Compare checks if ASPathSegments are the same

type Aggregator

type Aggregator struct {
	Address uint32
	ASN     uint16
}

Aggregator represents an AGGREGATOR attribute (type code 7) as in RFC4271

type ClusterList

type ClusterList []uint32

func (*ClusterList) String

func (cl *ClusterList) String() string

type Communities

type Communities []uint32

func (*Communities) String

func (c *Communities) String() string

type LargeCommunities

type LargeCommunities []LargeCommunity

func (*LargeCommunities) String

func (lc *LargeCommunities) String() string

type LargeCommunity

type LargeCommunity struct {
	GlobalAdministrator uint32
	DataPart1           uint32
	DataPart2           uint32
}

LargeCommunity represents a large community (RFC8195)

func LargeCommunityFromProtoCommunity

func LargeCommunityFromProtoCommunity(alc *api.LargeCommunity) LargeCommunity

LargeCommunityFromProtoCommunity converts a proto LargeCommunity to LargeCommunity

func ParseLargeCommunityString

func ParseLargeCommunityString(s string) (com LargeCommunity, err error)

ParseLargeCommunityString parses a human readable large community representation

func (*LargeCommunity) String

func (c *LargeCommunity) String() string

String transitions a large community to it's human readable representation

func (*LargeCommunity) ToProto

func (c *LargeCommunity) ToProto() *api.LargeCommunity

ToProto converts LargeCommunity to proto LargeCommunity

type UnknownPathAttribute

type UnknownPathAttribute struct {
	Optional   bool
	Transitive bool
	Partial    bool
	TypeCode   uint8
	Value      []byte
}

UnknownPathAttribute represents an unknown path attribute BIO does not support

func UnknownPathAttributeFromProtoUnknownPathAttribute

func UnknownPathAttributeFromProtoUnknownPathAttribute(x *api.UnknownPathAttribute) UnknownPathAttribute

UnknownPathAttributeFromProtoUnknownPathAttribute convers an proto UnknownPathAttribute to UnknownPathAttribute

func (*UnknownPathAttribute) Compare

Compare compares unknown attributes

func (*UnknownPathAttribute) ToProto

ToProto converts UnknownPathAttribute to proto UnknownPathAttribute

func (*UnknownPathAttribute) WireLength

func (u *UnknownPathAttribute) WireLength() uint16

WireLength returns the number of bytes the attribute need on the wire

Jump to

Keyboard shortcuts

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