bgpls

package module
v0.0.0-...-2928e13 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

This repository has been deprecated in favor of corebgp. Please consider using it instead.

bgpls Build Status GoDoc codecov

A BGP Link-State collector library for Go 1.9+.

Supported RFCs

Usage

Collector example

Documentation

Overview

Package bgpls is a bgp link-state collector library for Go

Index

Examples

Constants

This section is empty.

Variables

View Source
var ErrCollectorStopped = errors.New("collector is stopped")

ErrCollectorStopped is returned when an operation is not valid due to the collector being stopped

Functions

This section is empty.

Types

type AsPathSegment

type AsPathSegment interface {
	Type() AsPathSegmentType
	// contains filtered or unexported methods
}

AsPathSegment is contained in an as-path path attribute

type AsPathSegmentSequence

type AsPathSegmentSequence struct {
	Sequence []uint16
}

AsPathSegmentSequence is an ordered as-path segment

func (*AsPathSegmentSequence) Type

Type returns the appropriate AsPathSegmentType for AsPathSegmentSequence

type AsPathSegmentSet

type AsPathSegmentSet struct {
	Set []uint16
}

AsPathSegmentSet is an unordered as-path segment

func (*AsPathSegmentSet) Type

Type returns the appropriate AsPathSegmentType for AsPathSegmentSet

type AsPathSegmentType

type AsPathSegmentType uint8

AsPathSegmentType describes the type of AsPathSegment

const (
	AsPathSegmentSetType      AsPathSegmentType = 1
	AsPathSegmentSequenceType AsPathSegmentType = 2
)

AsPathSegmentType values

type BaseEvent

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

BaseEvent is included in every Event

func (*BaseEvent) Neighbor

func (b *BaseEvent) Neighbor() *NeighborConfig

Neighbor returns the NeighborConfig associated with the event

func (*BaseEvent) Timestamp

func (b *BaseEvent) Timestamp() time.Time

Timestamp returns the time at which the event occurred

type Collector

type Collector interface {
	Events() (<-chan Event, error)
	Config() *CollectorConfig
	AddNeighbor(c *NeighborConfig) error
	DeleteNeighbor(address net.IP) error
	Neighbors() ([]*NeighborConfig, error)
	Stop()
}

Collector is a BGP Link-State collector

Events() returns the events channel or an error if the collector has been stopped. The events channel is buffered, its size is configurable via CollectorConfig. The events channel should be read from in a loop. It will close only when Stop() is called.

Config() returns the configuration of the Collector.

AddNeighbor() initializes a new bgp-ls neighbor. An error is returned if the collector is stopped or the neighbor already exists.

DeleteNeighbor() shuts down and removes a neighbor from the collector. An error is returned if the collector is stopped or the neighbor does not exist.

Neighbors() returns the configuration of all neighbors.

Stop() stops the collector and all neighbors.

Example
package main

import (
	"log"
	"net"
	"time"

	"github.com/jwhited/bgpls"
)

func main() {
	collectorConfig := &bgpls.CollectorConfig{
		ASN:             uint32(64512),
		RouterID:        net.ParseIP("1.2.3.4"),
		EventBufferSize: 1024,
	}

	collector, err := bgpls.NewCollector(collectorConfig)
	if err != nil {
		log.Fatal(err)
	}

	neighborConfig := &bgpls.NeighborConfig{
		Address:  net.ParseIP("172.16.1.201"),
		ASN:      uint32(64512),
		HoldTime: time.Second * 30,
	}

	err = collector.AddNeighbor(neighborConfig)
	if err != nil {
		log.Fatal(err)
	}

	eventsChan, err := collector.Events()
	if err != nil {
		log.Fatal(err)
	}

	for {
		event := <-eventsChan
		// all Event types can be found in event.go (EventNeighbor**)
		switch e := event.(type) {
		case *bgpls.EventNeighborErr:
			log.Printf("neighbor %s, err: %v", e.Neighbor().Address, e.Err)
		case *bgpls.EventNeighborStateTransition:
			log.Printf("neighbor %s, state transition: %v", e.Neighbor().Address, e.State)
		case *bgpls.EventNeighborNotificationReceived:
			log.Printf("neighbor %s notification message code: %v", e.Neighbor().Address, e.Message.Code)
		case *bgpls.EventNeighborUpdateReceived:
			log.Printf("neighbor %s update message", e.Neighbor().Address)
		}
	}
}
Output:

func NewCollector

func NewCollector(config *CollectorConfig) (Collector, error)

NewCollector creates a Collector.

type CollectorConfig

type CollectorConfig struct {
	ASN             uint32
	RouterID        net.IP
	EventBufferSize uint64
}

CollectorConfig is the configuration for the Collector. EventBufferSize is the size of the buffered events channel returned from the Events() Collector method. It should be set to a value appropriate from a memory consumption perspective. Setting this value too low can inhibit bgp io.

type Event

type Event interface {
	Neighbor() *NeighborConfig
	Timestamp() time.Time
	Type() EventType
}

Event is a Collector event associated with a neighbor.

Neighbor() returns the associated neighbor's configuration.

Timestamp() returns the time at which the event occurred.

Type() returns the event type.

type EventNeighborErr

type EventNeighborErr struct {
	BaseEvent
	Err error
}

EventNeighborErr is generated when a neighbor encounters an error

func (*EventNeighborErr) Type

func (e *EventNeighborErr) Type() EventType

Type returns the appropriate EventType for EventNeighborErr

type EventNeighborHoldTimerExpired

type EventNeighborHoldTimerExpired struct {
	BaseEvent
}

EventNeighborHoldTimerExpired is generated when a neighbor's hold timer expires

func (*EventNeighborHoldTimerExpired) Type

Type returns the appropriate EventType for EventNeighborHoldTimerExpired

type EventNeighborNotificationReceived

type EventNeighborNotificationReceived struct {
	BaseEvent
	Message *NotificationMessage
}

EventNeighborNotificationReceived is generated when a notification message is received

func (*EventNeighborNotificationReceived) Type

Type returns the appropriate EventType for EventNeighborNotificationReceived

type EventNeighborStateTransition

type EventNeighborStateTransition struct {
	BaseEvent
	State FSMState
}

EventNeighborStateTransition is generated when a neighbor's fsm transitions to a new state

func (*EventNeighborStateTransition) Type

Type returns the appropriate EventType for EventNeighborStateTransition

type EventNeighborUpdateReceived

type EventNeighborUpdateReceived struct {
	BaseEvent
	Message *UpdateMessage
}

EventNeighborUpdateReceived is generated when an update message is received

func (*EventNeighborUpdateReceived) Type

Type returns the appropriate EventType for EventNeighborUpdateReceived

type EventType

type EventType int

EventType describes the type of event

const (
	EventTypeNeighborErr EventType
	EventTypeNeighborHoldTimerExpired
	EventTypeNeighborStateTransition
	EventTypeNeighborUpdateReceived
	EventTypeNeighborNotificationReceived
)

EventType values

func (EventType) String

func (e EventType) String() string

type FSMState

type FSMState uint8

FSMState describes the state of a neighbor's fsm

const (
	DisabledState FSMState = iota
	IdleState
	ConnectState
	ActiveState
	OpenSentState
	OpenConfirmState
	EstablishedState
)

FSMState values

func (FSMState) String

func (s FSMState) String() string

type LinkAttr

type LinkAttr interface {
	Code() LinkAttrCode
	// contains filtered or unexported methods
}

LinkAttr is a link attribute contained in a bgp-ls attribute.

type LinkAttrAdjSID

type LinkAttrAdjSID struct {
	Flags         LinkAttrAdjSIDFlags
	Weight        uint8
	SIDIndexLabel SIDIndexLabel
}

LinkAttrAdjSID is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.2.1

func (*LinkAttrAdjSID) Code

func (l *LinkAttrAdjSID) Code() LinkAttrCode

Code returns the appropriate LinkAttrCode for LinkAttrCodeAdjSID.

type LinkAttrAdjSIDFlags

type LinkAttrAdjSIDFlags interface {
	Type() LinkAttrAdjSIDFlagsType
	// contains filtered or unexported methods
}

LinkAttrAdjSIDFlags are contained in the LinkAttrAdjSID link attribute.

type LinkAttrAdjSIDFlagsIsIs

type LinkAttrAdjSIDFlagsIsIs struct {
	AddressFamily bool
	Backup        bool
	Value         bool
	Local         bool
	Set           bool
	Persistent    bool
}

LinkAttrAdjSIDFlagsIsIs are contained in the LinkAttrAdjSID link attribute.

https://tools.ietf.org/html/draft-ietf-isis-segment-routing-extensions-15#section-2.2.1

func (*LinkAttrAdjSIDFlagsIsIs) Type

Type returns the appropriate LinkAttrAdjSIDFlagsType for LinkAttrAdjSIDFlagsIsIs

type LinkAttrAdjSIDFlagsOspf

type LinkAttrAdjSIDFlagsOspf struct {
	Backup     bool
	Value      bool
	Local      bool
	Group      bool
	Persistent bool
}

LinkAttrAdjSIDFlagsOspf are contained in the LinkAttrAdjSID link attribute.

https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-24#section-6.1

func (*LinkAttrAdjSIDFlagsOspf) Type

Type returns the appropriate LinkAttrAdjSIDFlagsType for LinkAttrAdjSIDFlagsOspf

type LinkAttrAdjSIDFlagsType

type LinkAttrAdjSIDFlagsType uint8

LinkAttrAdjSIDFlagsType describes the type of LinkAttrAdjSIDFlags

const (
	LinkAttrAdjSIDFlagsTypeIsIs LinkAttrAdjSIDFlagsType = iota
	LinkAttrAdjSIDFlagsTypeOspf
)

LinkAttrAdjSIDFlags values

type LinkAttrAdminGroup

type LinkAttrAdminGroup struct {
	Group [32]bool
}

LinkAttrAdminGroup is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc5305#section-3.1

func (*LinkAttrAdminGroup) Code

func (l *LinkAttrAdminGroup) Code() LinkAttrCode

Code returns the appropriate LinkAttrCode for LinkAttrAdminGroup.

type LinkAttrCode

type LinkAttrCode uint16

LinkAttrCode describes the type of node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.2

const (
	LinkAttrCodeRemoteIPv4RouterID         LinkAttrCode = 1030
	LinkAttrCodeRemoteIPv6RouterID         LinkAttrCode = 1031
	LinkAttrCodeAdminGroup                 LinkAttrCode = 1088
	LinkAttrCodeMaxLinkBandwidth           LinkAttrCode = 1089
	LinkAttrCodeMaxReservableLinkBandwidth LinkAttrCode = 1090
	LinkAttrCodeUnreservedBandwidth        LinkAttrCode = 1091
	LinkAttrCodeTEDefaultMetric            LinkAttrCode = 1092
	LinkAttrCodeLinkProtectionType         LinkAttrCode = 1093
	LinkAttrCodeMplsProtocolMask           LinkAttrCode = 1094
	LinkAttrCodeIgpMetric                  LinkAttrCode = 1095
	LinkAttrCodeSharedRiskLinkGroup        LinkAttrCode = 1096
	LinkAttrCodeOpaqueLinkAttr             LinkAttrCode = 1097
	LinkAttrCodeLinkName                   LinkAttrCode = 1098
	LinkAttrCodeAdjSID                     LinkAttrCode = 1099
	LinkAttrCodeLanAdjSID                  LinkAttrCode = 1100
	LinkAttrCodePeerNodeSID                LinkAttrCode = 1101
	LinkAttrCodePeerAdjSID                 LinkAttrCode = 1102
	LinkAttrCodePeerSetSID                 LinkAttrCode = 1103
	LinkAttrCodeUniLinkDelay               LinkAttrCode = 1114
	LinkAttrCodeMinMaxUniLinkDelay         LinkAttrCode = 1115
	LinkAttrCodeUniDelayVariation          LinkAttrCode = 1116
	LinkAttrCodeUniPacketLoss              LinkAttrCode = 1117
	LinkAttrCodeUniResidualBandwidth       LinkAttrCode = 1118
	LinkAttrCodeUniAvailableBandwidth      LinkAttrCode = 1119
	LinkAttrCodeUniBandwidthUtil           LinkAttrCode = 1120
	LinkAttrCodeL2BundleMember             LinkAttrCode = 1172
)

LinkAttrCode values

type LinkAttrIgpMetric

type LinkAttrIgpMetric struct {
	Metric uint32
	Type   LinkAttrIgpMetricType
}

LinkAttrIgpMetric is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.2.4

func (*LinkAttrIgpMetric) Code

func (l *LinkAttrIgpMetric) Code() LinkAttrCode

Code returns the appropriate LinkAttrCode for LinkAttrIgpMetric.

type LinkAttrIgpMetricType

type LinkAttrIgpMetricType uint8

LinkAttrIgpMetricType describes the type of igp metric contained in a LinkAttrIgpMetric

https://tools.ietf.org/html/rfc7752#section-3.3.2.4

const (
	LinkAttrIgpMetricIsIsSmallType LinkAttrIgpMetricType = iota
	LinkAttrIgpMetricOspfType
	LinkAttrIgpMetricIsIsWideType
)

LinkAttrIgpMetricType values

type LinkAttrL2BundleMember

type LinkAttrL2BundleMember struct {
	MemberDescriptor uint32
	LinkAttrs        []LinkAttr
}

LinkAttrL2BundleMember is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.2.3

func (*LinkAttrL2BundleMember) Code

Code returns the appropriate LinkAttrCode for LinkAttrL2BundleMember

type LinkAttrLanAdjSID

type LinkAttrLanAdjSID struct {
	Flags              LinkAttrAdjSIDFlags
	Weight             uint8
	NeighborIDSystemID LinkAttrLanAdjSIDProtoSpecificID
	SIDIndexLabel      SIDIndexLabel
}

LinkAttrLanAdjSID is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.2.2

func (*LinkAttrLanAdjSID) Code

func (l *LinkAttrLanAdjSID) Code() LinkAttrCode

Code returns the appropriate LinkAttrCode for LinkAttrLanAdjSID

type LinkAttrLanAdjSIDProtoSpecificID

type LinkAttrLanAdjSIDProtoSpecificID interface {
	Type() LinkAttrLanAdjSIDProtoSpecificIDType
	// contains filtered or unexported methods
}

LinkAttrLanAdjSIDProtoSpecificID is contained in the LinkAttrLanAdjSID link attribute.

type LinkAttrLanAdjSIDProtoSpecificIDIsIs

type LinkAttrLanAdjSIDProtoSpecificIDIsIs struct {
	SystemID [6]byte
}

LinkAttrLanAdjSIDProtoSpecificIDIsIs is contained in a LinkAttrLanAdjSID link attribute.

func (*LinkAttrLanAdjSIDProtoSpecificIDIsIs) Type

Type returns the appropriate LinkAttrLanAdjSIDProtoSpecificIDType for LinkAttrLanAdjSIDProtoSpecificIDIsIs.

type LinkAttrLanAdjSIDProtoSpecificIDOspf

type LinkAttrLanAdjSIDProtoSpecificIDOspf struct {
	NeighborID uint32
}

LinkAttrLanAdjSIDProtoSpecificIDOspf is contained in a LinkAttrLanAdjSID link attribute.

func (*LinkAttrLanAdjSIDProtoSpecificIDOspf) Type

Type returns the appropriate LinkAttrLanAdjSIDProtoSpecificIDType for LinkAttrLanAdjSIDProtoSpecificIDOspf

type LinkAttrLanAdjSIDProtoSpecificIDType

type LinkAttrLanAdjSIDProtoSpecificIDType uint8

LinkAttrLanAdjSIDProtoSpecificIDType describes the type of LinkAttrLanAdjSIDProtoSpecificID.

const (
	LinkAttrLanAdjSIDProtoSpecificIDTypeIsIs LinkAttrLanAdjSIDProtoSpecificIDType = iota
	LinkAttrLanAdjSIDProtoSpecificIDTypeOspf
)

LinkAttrLanAdjSIDProtoSpecificIDType values

type LinkAttrLinkName

type LinkAttrLinkName struct {
	Name string
}

LinkAttrLinkName is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.2.7

func (*LinkAttrLinkName) Code

func (l *LinkAttrLinkName) Code() LinkAttrCode

Code returns the appropriate LinkAttrCode for LinkAttrLinkName.

type LinkAttrLinkProtectionType

type LinkAttrLinkProtectionType struct {
	ExtraTraffic        bool
	Unprotected         bool
	Shared              bool
	DedicatedOneToOne   bool
	DedicatedOnePlusOne bool
	Enhanced            bool
}

LinkAttrLinkProtectionType is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc5307#section-1.2

func (*LinkAttrLinkProtectionType) Code

Code returns the appropriate LinkAttrCode for LinkAttrLinkProtectionType.

type LinkAttrMaxLinkBandwidth

type LinkAttrMaxLinkBandwidth struct {
	BytesPerSecond float32
}

LinkAttrMaxLinkBandwidth is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc5305#section-3.4

func (*LinkAttrMaxLinkBandwidth) Code

Code returns the appropriate LinkAttrCode for LinkAttrMaxLinkBandwidth.

type LinkAttrMaxReservableLinkBandwidth

type LinkAttrMaxReservableLinkBandwidth struct {
	BytesPerSecond float32
}

LinkAttrMaxReservableLinkBandwidth is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc5305#section-3.5

func (*LinkAttrMaxReservableLinkBandwidth) Code

Code returns the appropriate LinkAttrCode for LinkAttrMaxReservableLinkBandwidth.

type LinkAttrMinMaxUniLinkDelay

type LinkAttrMinMaxUniLinkDelay struct {
	Anomalous bool
	MinDelay  time.Duration
	MaxDelay  time.Duration
}

LinkAttrMinMaxUniLinkDelay is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-te-pm-bgp-08#section-3.2

func (*LinkAttrMinMaxUniLinkDelay) Code

Code returns the appropriate LinkAttrCode for LinkAttrMinMaxUniLinkDelay

type LinkAttrMplsProtocolMask

type LinkAttrMplsProtocolMask struct {
	LDP    bool
	RsvpTE bool
}

LinkAttrMplsProtocolMask is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.2.2

func (*LinkAttrMplsProtocolMask) Code

Code returns the appropriate LinkAttrCode for LinkAttrMplsProtocolMask.

type LinkAttrOpaqueLinkAttr

type LinkAttrOpaqueLinkAttr struct {
	Data []byte
}

LinkAttrOpaqueLinkAttr is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.2.6

func (*LinkAttrOpaqueLinkAttr) Code

Code returns the appropriate LinkAttrCode for LinkAttrOpaqueLinkAttr.

type LinkAttrPeerAdjSID

type LinkAttrPeerAdjSID struct {
	Value         bool
	Local         bool
	Backup        bool
	Persistent    bool
	Weight        uint8
	SIDIndexLabel SIDIndexLabel
}

LinkAttrPeerAdjSID is a link attribute contained a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-15#section-4.4

func (*LinkAttrPeerAdjSID) Code

func (l *LinkAttrPeerAdjSID) Code() LinkAttrCode

Code returns the appropriate LinkAttrCode for LinkAttrPeerAdjSID

type LinkAttrPeerNodeSID

type LinkAttrPeerNodeSID struct {
	Weight        uint8
	SIDIndexLabel SIDIndexLabel
}

LinkAttrPeerNodeSID is a link attribute contained a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-15#section-4.4

func (*LinkAttrPeerNodeSID) Code

Code returns the appropriate LinkAttrCode for LinkAttrPeerNodeSID.

type LinkAttrPeerSetSID

type LinkAttrPeerSetSID struct {
	Weight        uint8
	SIDIndexLabel SIDIndexLabel
}

LinkAttrPeerSetSID is a link attributed contained a bgp-ls attribute

https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-15#section-4.4

func (*LinkAttrPeerSetSID) Code

func (l *LinkAttrPeerSetSID) Code() LinkAttrCode

Code returns the appropriate LinkAttrCode for LinkAttrPeerSetSID

type LinkAttrRemoteIPv4RouterID

type LinkAttrRemoteIPv4RouterID struct {
	Address net.IP
}

LinkAttrRemoteIPv4RouterID is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc5305#section-4.3

func (*LinkAttrRemoteIPv4RouterID) Code

Code returns the appropriate LinkAttrCode for LinkAttrRemoteIPv4RouterID.

type LinkAttrRemoteIPv6RouterID

type LinkAttrRemoteIPv6RouterID struct {
	Address net.IP
}

LinkAttrRemoteIPv6RouterID is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc6119#section-4.1

func (*LinkAttrRemoteIPv6RouterID) Code

Code returns the appropriate LinkAttrCode for LinkAttrRemoteIPv6RouterID.

type LinkAttrSharedRiskLinkGroup

type LinkAttrSharedRiskLinkGroup struct {
	Groups []uint32
}

LinkAttrSharedRiskLinkGroup is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.2.5

func (*LinkAttrSharedRiskLinkGroup) Code

Code returns the appropriate LinkAttrCode for LinkAttrSharedRiskLinkGroups.

type LinkAttrTEDefaultMetric

type LinkAttrTEDefaultMetric struct {
	Metric uint32
}

LinkAttrTEDefaultMetric is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc5305#section-3.7

func (*LinkAttrTEDefaultMetric) Code

Code returns the appropriate LinkAttrCode for LinkAttrTEDefaultMetric.

type LinkAttrUniAvailableBandwidth

type LinkAttrUniAvailableBandwidth struct {
	BytesPerSecond float32
}

LinkAttrUniAvailableBandwidth is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-te-pm-bgp-08#section-3.6

func (*LinkAttrUniAvailableBandwidth) Code

Code returns the appropriate LinkAttrCode for LinkAttrUniAvailableBandwidth

type LinkAttrUniBandwidthUtil

type LinkAttrUniBandwidthUtil struct {
	BytesPerSecond float32
}

LinkAttrUniBandwidthUtil is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-te-pm-bgp-08#section-3.7

func (*LinkAttrUniBandwidthUtil) Code

Code returns the appropriate LinkAttrCode for LinkAttrUniBandwidthUtil

type LinkAttrUniDelayVariation

type LinkAttrUniDelayVariation struct {
	DelayVariation time.Duration
}

LinkAttrUniDelayVariation is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-te-pm-bgp-08#section-3.3

func (*LinkAttrUniDelayVariation) Code

Code returns the appropriate LinkAttrCode for LinkAttrUniDelayVariation

type LinkAttrUniLinkDelay

type LinkAttrUniLinkDelay struct {
	Anomalous bool
	Delay     time.Duration
}

LinkAttrUniLinkDelay is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-te-pm-bgp-08#section-3.1

func (*LinkAttrUniLinkDelay) Code

Code returns the appropriate LinkAttrCode for LinkAttrUniLinkDelay

type LinkAttrUniPacketLoss

type LinkAttrUniPacketLoss struct {
	Anomalous   bool
	LossPercent float64
}

LinkAttrUniPacketLoss is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-te-pm-bgp-08#section-3.4

func (*LinkAttrUniPacketLoss) Code

Code returns the appropriate LinkAttrCode for LinkAttrUniPacketLoss

type LinkAttrUniResidualBandwidth

type LinkAttrUniResidualBandwidth struct {
	BytesPerSecond float32
}

LinkAttrUniResidualBandwidth is a link attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-te-pm-bgp-08#section-3.5

func (*LinkAttrUniResidualBandwidth) Code

Code returns the appropriate LinkAttrCode for LinkAttrUniResidualBandwidth

type LinkAttrUnreservedBandwidth

type LinkAttrUnreservedBandwidth struct {
	BytesPerSecond [8]float32
}

LinkAttrUnreservedBandwidth is a link attribute contained in a bgp-ls attribute. The index number represents the priority level.

https://tools.ietf.org/html/rfc5305#section-3.6

func (*LinkAttrUnreservedBandwidth) Code

Code returns the appropriate LinkAttrCode for LinkAttrUnreservedBandwidth.

type LinkDescriptor

type LinkDescriptor interface {
	Code() LinkDescriptorCode
	// contains filtered or unexported methods
}

LinkDescriptor is a bgp-ls nlri.

type LinkDescriptorCode

type LinkDescriptorCode uint16

LinkDescriptorCode describes the type of link descriptor.

https://tools.ietf.org/html/rfc7752#section-3.2.2 table 5

const (
	LinkDescriptorCodeLinkIDs              LinkDescriptorCode = 258
	LinkDescriptorCodeIPv4InterfaceAddress LinkDescriptorCode = 259
	LinkDescriptorCodeIPv4NeighborAddress  LinkDescriptorCode = 260
	LinkDescriptorCodeIPv6InterfaceAddress LinkDescriptorCode = 261
	LinkDescriptorCodeIPv6NeighborAddress  LinkDescriptorCode = 262
	LinkDescriptorCodeMultiTopologyID      LinkDescriptorCode = 263
)

LinkDescriptorCode values

type LinkDescriptorIPv4InterfaceAddress

type LinkDescriptorIPv4InterfaceAddress struct {
	Address net.IP
}

LinkDescriptorIPv4InterfaceAddress is a link descriptor contained in a bgp-ls link nlri.

https://tools.ietf.org/html/rfc5305#section-3.2

func (*LinkDescriptorIPv4InterfaceAddress) Code

Code returns the appropriate LinkDescriptorCode for LinkDescriptorIPv4InterfaceAddress.

type LinkDescriptorIPv4NeighborAddress

type LinkDescriptorIPv4NeighborAddress struct {
	Address net.IP
}

LinkDescriptorIPv4NeighborAddress is a link descriptor contained in a bgp-ls link nlri.

https://tools.ietf.org/html/rfc5305#section-3.3

func (*LinkDescriptorIPv4NeighborAddress) Code

Code returns the appropriate LinkDescriptorCode for LinkDescriptorIPv4NeighborAddress.

type LinkDescriptorIPv6InterfaceAddress

type LinkDescriptorIPv6InterfaceAddress struct {
	Address net.IP
}

LinkDescriptorIPv6InterfaceAddress is a link descriptor contained in a bgp-ls link nlri.

https://tools.ietf.org/html/rfc6119#section-4.2

func (*LinkDescriptorIPv6InterfaceAddress) Code

Code returns the appropriate LinkDescriptorCode for LinkDescriptorIPv6InterfaceAddress.

type LinkDescriptorIPv6NeighborAddress

type LinkDescriptorIPv6NeighborAddress struct {
	Address net.IP
}

LinkDescriptorIPv6NeighborAddress is a link descriptor contained in a bgp-ls link nlri.

https://tools.ietf.org/html/rfc6119#section-4.3

func (*LinkDescriptorIPv6NeighborAddress) Code

Code returns the appropriate LinkDescriptorCode for LinkDescriptorIPv6NeighborAddress.

type LinkDescriptorLinkIDs

type LinkDescriptorLinkIDs struct {
	LocalID  uint32
	RemoteID uint32
}

LinkDescriptorLinkIDs is a link descriptor contained in a bgp-ls link nlri.

https://tools.ietf.org/html/rfc5307#section-1.1

func (*LinkDescriptorLinkIDs) Code

Code returns the appropriate LinkDescriptorCode for LinkDescriptorLinkIDs.

type LinkDescriptorMultiTopologyID

type LinkDescriptorMultiTopologyID struct {
	IDs []uint16
}

LinkDescriptorMultiTopologyID is a link descriptor contained in a bgp-ls link nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.5

func (*LinkDescriptorMultiTopologyID) Code

Code returns the appropriate LinkDescriptorCode for LinkDescriptorMultiTopologyID.

type LinkStateNlri

type LinkStateNlri interface {
	Type() LinkStateNlriType
	Protocol() LinkStateNlriProtocolID
	Afi() MultiprotoAfi
	Safi() MultiprotoSafi
	// contains filtered or unexported methods
}

LinkStateNlri contains nlri of link-state type.

type LinkStateNlriDescriptorCode

type LinkStateNlriDescriptorCode uint16

LinkStateNlriDescriptorCode describes the type of link state nlri.

const (
	LinkStateNlriLocalNodeDescriptorsDescriptorCode  LinkStateNlriDescriptorCode = 256
	LinkStateNlriRemoteNodeDescriptorsDescriptorCode LinkStateNlriDescriptorCode = 257
)

LinkStateNlriDescriptorCode values

type LinkStateNlriIPv4Prefix

type LinkStateNlriIPv4Prefix struct {
	LinkStateNlriPrefix
}

LinkStateNlriIPv4Prefix is a link state nlri.

https://tools.ietf.org/html/rfc7752#section-3.2 figure 9

func (*LinkStateNlriIPv4Prefix) Type

Type returns the appropriate LinkStateNlriType for LinkStateNlriIPv4Prefix

type LinkStateNlriIPv6Prefix

type LinkStateNlriIPv6Prefix struct {
	LinkStateNlriPrefix
}

LinkStateNlriIPv6Prefix is a link state nlri.

https://tools.ietf.org/html/rfc7752#section-3.2 figure 9

func (*LinkStateNlriIPv6Prefix) Type

Type returns the appropriate LinkStateNlriType for LinkStateNlriIPv6Prefix

type LinkStateNlriLink struct {
	ProtocolID            LinkStateNlriProtocolID
	ID                    uint64
	LocalNodeDescriptors  []NodeDescriptor
	RemoteNodeDescriptors []NodeDescriptor
	LinkDescriptors       []LinkDescriptor
}

LinkStateNlriLink is a link state nlri.

https://tools.ietf.org/html/rfc7752#section-3.2 figure 8

func (*LinkStateNlriLink) Afi

Afi returns the appropriate MultiprotoAfi for LinkStateNlriLink

func (*LinkStateNlriLink) Protocol

Protocol returns the appropriate LinkStateNlriProtocolID for LinkStateNlriLink

func (*LinkStateNlriLink) Safi

Safi returns the appropriate MultiprotoAfi for LinkStateNlriLink

func (*LinkStateNlriLink) Type

Type returns the appropriate LinkStateNlriType for LinkStateNlriLink

type LinkStateNlriNode

type LinkStateNlriNode struct {
	ProtocolID           LinkStateNlriProtocolID
	ID                   uint64
	LocalNodeDescriptors []NodeDescriptor
}

LinkStateNlriNode is a link state nlri.

https://tools.ietf.org/html/rfc7752#section-3.2 figure 7

func (*LinkStateNlriNode) Afi

Afi returns the appropriate MultiprotoAfi for LinkStateNlriNode

func (*LinkStateNlriNode) Protocol

Protocol returns the appropriate LinkStateNlriProtocolID for LinkStateNlriNode

func (*LinkStateNlriNode) Safi

Safi returns the appropriate MultiprotoAfi for LinkStateNlriNode

func (*LinkStateNlriNode) Type

Type returns the appropriate LinkStateNlriType for LinkStateNlriNode

type LinkStateNlriPrefix

type LinkStateNlriPrefix struct {
	ProtocolID           LinkStateNlriProtocolID
	ID                   uint64
	LocalNodeDescriptors []NodeDescriptor
	PrefixDescriptors    []PrefixDescriptor
}

LinkStateNlriPrefix is a link state nlri.

https://tools.ietf.org/html/rfc7752#section-3.2 figure 9

func (*LinkStateNlriPrefix) Afi

Afi returns the appropriate MultiprotoAfi for LinkStateNlriPrefix

func (*LinkStateNlriPrefix) Protocol

Protocol returns the appropriate LinkStateNlriProtocolID for LinkStateNlriPrefix

func (*LinkStateNlriPrefix) Safi

Safi returns the appropriate MultiprotoAfi for LinkStateNlriPrefix

type LinkStateNlriProtocolID

type LinkStateNlriProtocolID uint8

LinkStateNlriProtocolID describes the protocol of the link state nlri.

https://tools.ietf.org/html/rfc7752#section-3.2 table 2

const (
	LinkStateNlriIsIsL1ProtocolID LinkStateNlriProtocolID
	LinkStateNlriIsIsL2ProtocolID
	LinkStateNlriOSPFv2ProtocolID
	LinkStateNlriDirectProtocolID
	LinkStateNlriStaticProtocolID
	LinkStateNlriOSPFv3ProtocolID
	LinkStateNlriBgpProtocolID
)

LinkStateNlriProtocolID values

type LinkStateNlriType

type LinkStateNlriType uint16

LinkStateNlriType describes the type of bgp-ls nlri.

https://tools.ietf.org/html/rfc7752#section-3.2 figure 6

const (
	LinkStateNlriNodeType LinkStateNlriType
	LinkStateNlriLinkType
	LinkStateNlriIPv4PrefixType
	LinkStateNlriIPv6PrefixType
)

LinkStateNlriType values

type Message

type Message interface {
	MessageType() MessageType
	// contains filtered or unexported methods
}

Message is a bgp message.

type MessageType

type MessageType uint8

MessageType describes the type of bgp message.

const (
	OpenMessageType         MessageType = 1
	UpdateMessageType       MessageType = 2
	NotificationMessageType MessageType = 3
	KeepAliveMessageType    MessageType = 4
)

MessageType values

func (MessageType) String

func (t MessageType) String() string

type MultiprotoAfi

type MultiprotoAfi uint16

MultiprotoAfi identifies the address family for multiprotocol bgp.

const (
	BgpLsAfi MultiprotoAfi = 16388
)

MultiprotoAfi values

type MultiprotoSafi

type MultiprotoSafi uint8

MultiprotoSafi identifies the subsequent address family for multiprotocol bgp.

const (
	BgpLsSafi MultiprotoSafi = 71
)

MultiprotoSafi values

type NeighborConfig

type NeighborConfig struct {
	Address  net.IP
	ASN      uint32
	HoldTime time.Duration
}

NeighborConfig is the configuration for a BGP-LS neighbor.

type NodeAttr

type NodeAttr interface {
	Code() NodeAttrCode
	// contains filtered or unexported methods
}

NodeAttr is a node attribute contained in a bgp-ls attribute.

type NodeAttrCode

type NodeAttrCode uint16

NodeAttrCode describes the type of node attribute contained in a bgp-ls attribute

https://tools.ietf.org/html/rfc7752#section-3.3.1

const (
	NodeAttrCodeMultiTopologyID   NodeAttrCode = 263
	NodeAttrCodeNodeFlagBits      NodeAttrCode = 1024
	NodeAttrCodeOpaqueNodeAttr    NodeAttrCode = 1025
	NodeAttrCodeNodeName          NodeAttrCode = 1026
	NodeAttrCodeIsIsAreaID        NodeAttrCode = 1027
	NodeAttrCodeLocalIPv4RouterID NodeAttrCode = 1028
	NodeAttrCodeLocalIPv6RouterID NodeAttrCode = 1029
	NodeAttrCodeSRCaps            NodeAttrCode = 1034
	NodeAttrCodeSRAlgo            NodeAttrCode = 1035
	NodeAttrCodeSRLocalBlock      NodeAttrCode = 1036
	NodeAttrCodeSRMSPref          NodeAttrCode = 1037
)

NodeAttrCode values

type NodeAttrIsIsAreaID

type NodeAttrIsIsAreaID struct {
	AreaID uint32
}

NodeAttrIsIsAreaID is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.1.2

func (*NodeAttrIsIsAreaID) Code

func (n *NodeAttrIsIsAreaID) Code() NodeAttrCode

Code returns the appropriate NodeAttrCode for NodeAttrIsIsAreaID.

type NodeAttrLocalIPv4RouterID

type NodeAttrLocalIPv4RouterID struct {
	Address net.IP
}

NodeAttrLocalIPv4RouterID is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc5305#section-4.3

func (*NodeAttrLocalIPv4RouterID) Code

Code returns the appropriate NodeAttrCode for NodeAttrLocalIPv4RouterID.

type NodeAttrLocalIPv6RouterID

type NodeAttrLocalIPv6RouterID struct {
	Address net.IP
}

NodeAttrLocalIPv6RouterID is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc5305#section-4.1

func (*NodeAttrLocalIPv6RouterID) Code

Code returns the appropriate NodeAttrCode for NodeAttrLocalIPv6RouterID.

type NodeAttrMultiTopologyID

type NodeAttrMultiTopologyID struct {
	IDs []uint16
}

NodeAttrMultiTopologyID is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.2.1.5

func (*NodeAttrMultiTopologyID) Code

Code returns the appropriate NodeAttrCode for NodeAttrMultiTopologyID.

type NodeAttrNodeFlagBits

type NodeAttrNodeFlagBits struct {
	Overload bool
	Attached bool
	External bool
	ABR      bool
	Router   bool
	V6       bool
}

NodeAttrNodeFlagBits is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.1.1

func (*NodeAttrNodeFlagBits) Code

Code returns the appropriate NodeAttrCode for NodeAttrNodeFlagBits.

type NodeAttrNodeName

type NodeAttrNodeName struct {
	Name string
}

NodeAttrNodeName is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.1.3

func (*NodeAttrNodeName) Code

func (n *NodeAttrNodeName) Code() NodeAttrCode

Code returns the appropriate NodeAttrCode for NodeAttrNodeName.

type NodeAttrOpaqueNodeAttr

type NodeAttrOpaqueNodeAttr struct {
	Data []byte
}

NodeAttrOpaqueNodeAttr is a node attribute contained a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.1.5

func (*NodeAttrOpaqueNodeAttr) Code

Code returns the appropriate NodeAttrCode for NodeAttrOpaqueNodeAttr.

type NodeAttrSRAlgo

type NodeAttrSRAlgo struct {
	Algos []uint8
}

NodeAttrSRAlgo is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext#section-2.1.3

func (*NodeAttrSRAlgo) Code

func (n *NodeAttrSRAlgo) Code() NodeAttrCode

Code returns the appropriate NodeAttrCode for NodeAttrSRAlgo

type NodeAttrSRCaps

type NodeAttrSRCaps struct {
	MplsIPv4      bool
	MplsIPv6      bool
	RangeSIDLabel []RangeSIDLabel
}

NodeAttrSRCaps is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.1.2

func (*NodeAttrSRCaps) Code

func (n *NodeAttrSRCaps) Code() NodeAttrCode

Code returns the appropriate NodeAttrCode for NodeAttrSRCaps

type NodeAttrSRLocalBlock

type NodeAttrSRLocalBlock struct {
	RangeSIDLabel []RangeSIDLabel
}

NodeAttrSRLocalBlock is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.1.4

func (*NodeAttrSRLocalBlock) Code

Code returns the appropriate NodeAttrCode for NodeAttrSRLocalBlock

type NodeAttrSRMSPref

type NodeAttrSRMSPref struct {
	Preference uint8
}

NodeAttrSRMSPref is a node attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.1.5

func (*NodeAttrSRMSPref) Code

func (n *NodeAttrSRMSPref) Code() NodeAttrCode

Code returns the appropriate NodeAttrCode for NodeAttrSRMSPref

type NodeDescriptor

type NodeDescriptor interface {
	Code() NodeDescriptorCode
	// contains filtered or unexported methods
}

NodeDescriptor is a bgp-ls nlri node descriptor.

https://tools.ietf.org/html/rfc7752#section-3.2.1

type NodeDescriptorASN

type NodeDescriptorASN struct {
	ASN uint32
}

NodeDescriptorASN is a node descriptor contained in a bgp-ls node nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

func (*NodeDescriptorASN) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorASN.

type NodeDescriptorBgpLsID

type NodeDescriptorBgpLsID struct {
	ID uint32
}

NodeDescriptorBgpLsID is a node descriptor contained in a bgp-ls node nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

func (*NodeDescriptorBgpLsID) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorBgpLsID.

type NodeDescriptorBgpRouterID

type NodeDescriptorBgpRouterID struct {
	RouterID net.IP
}

NodeDescriptorBgpRouterID is a node descriptor contained in a bgp-ls node nlri

https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-15#section-4.1

func (*NodeDescriptorBgpRouterID) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorBgpRouterID

type NodeDescriptorCode

type NodeDescriptorCode uint16

NodeDescriptorCode describes the type of node descriptor.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

const (
	NodeDescriptorCodeASN         NodeDescriptorCode = 512
	NodeDescriptorCodeBgpLsID     NodeDescriptorCode = 513
	NodeDescriptorCodeOspfAreaID  NodeDescriptorCode = 514
	NodeDescriptorCodeIgpRouterID NodeDescriptorCode = 515
	NodeDescriptorCodeBgpRouterID NodeDescriptorCode = 516
	NodeDescriptorCodeMemberASN   NodeDescriptorCode = 517
)

NodeDescriptorCode values

type NodeDescriptorIgpRouterIDIsIsNonPseudo

type NodeDescriptorIgpRouterIDIsIsNonPseudo struct {
	IsoNodeID uint64
}

NodeDescriptorIgpRouterIDIsIsNonPseudo is a node descriptor contained in a bgp-ls node nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

func (*NodeDescriptorIgpRouterIDIsIsNonPseudo) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorIgpRouterIDIsIsNonPseudo.

type NodeDescriptorIgpRouterIDIsIsPseudo

type NodeDescriptorIgpRouterIDIsIsPseudo struct {
	IsoNodeID uint64
	PsnID     uint8
}

NodeDescriptorIgpRouterIDIsIsPseudo is a node descriptor contained in a bgp-ls node nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

func (*NodeDescriptorIgpRouterIDIsIsPseudo) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorIgpRouterIDIsIsPseudo.

type NodeDescriptorIgpRouterIDOspfNonPseudo

type NodeDescriptorIgpRouterIDOspfNonPseudo struct {
	RouterID net.IP
}

NodeDescriptorIgpRouterIDOspfNonPseudo is a node descriptor contained in a bgp-ls node nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

func (*NodeDescriptorIgpRouterIDOspfNonPseudo) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorIgpRouterIDOspfNonPseudo.

type NodeDescriptorIgpRouterIDOspfPseudo

type NodeDescriptorIgpRouterIDOspfPseudo struct {
	DrRouterID       net.IP
	DrInterfaceToLAN net.IP
}

NodeDescriptorIgpRouterIDOspfPseudo is a node descriptor contained in a bgp-ls node nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

func (*NodeDescriptorIgpRouterIDOspfPseudo) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorIgpRouterIDOspfPseudo.

type NodeDescriptorIgpRouterIDType

type NodeDescriptorIgpRouterIDType uint8

NodeDescriptorIgpRouterIDType describes the type of igp router id.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

const (
	NodeDescriptorIgpRouterIDIsIsNonPseudoType NodeDescriptorIgpRouterIDType = iota
	NodeDescriptorIgpRouterIDIsIsPseudoType
	NodeDescriptorIgpRouterIDOspfNonPseudoType
	NodeDescriptorIgpRouterIDOspfPseudoType
)

NodeDescriptorIgRouterIDType values

type NodeDescriptorMemberASN

type NodeDescriptorMemberASN struct {
	ASN uint32
}

NodeDescriptorMemberASN is a node descriptor contained in a bgp-ls node nlri

https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-15#section-4.1

func (*NodeDescriptorMemberASN) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorMemberASN

type NodeDescriptorOspfAreaID

type NodeDescriptorOspfAreaID struct {
	ID uint32
}

NodeDescriptorOspfAreaID is a node descriptor contained in a bgp-ls node nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.4

func (*NodeDescriptorOspfAreaID) Code

Code returns the appropriate NodeDescriptorCode for NodeDescriptorOspfAreaID.

type NotifErrCode

type NotifErrCode uint8

NotifErrCode is a notifcation message error code.

const (
	NotifErrCodeMessageHeader NotifErrCode
	NotifErrCodeOpenMessage
	NotifErrCodeUpdateMessage
	NotifErrCodeHoldTimerExpired
	NotifErrCodeFsmError
	NotifErrCodeCease
)

NotifErrCode values

type NotifErrSubcode

type NotifErrSubcode uint8

NotifErrSubcode is a notification message error subcode.

const (
	NotifErrSubcodeConnNotSynch NotifErrSubcode
	NotifErrSubcodeBadLength
	NotifErrSubcodeBadType
)

message header subcodes

const (
	NotifErrSubcodeUnsupportedVersionNumber NotifErrSubcode
	NotifErrSubcodeBadPeerAS
	NotifErrSubcodeBadBgpID
	NotifErrSubcodeUnsupportedOptParam

	NotifErrSubcodeUnacceptableHoldTime
	NotifErrSubcodeUnsupportedCapability
)

open message subcodes

const (
	NotifErrSubcodeMalformedAttr NotifErrSubcode
	NotifErrSubcodeUnrecognizedWellKnownAttr
	NotifErrSubcodeMissingWellKnownAttr
	NotifErrSubcodeAttrFlagsError
	NotifErrSubcodeAttrLenError
	NotifErrSubcodeInvalidOrigin

	NotifErrSubcodeInvalidNextHop
	NotifErrSubcodeOptionalAttrError
	NotifErrSubcodeInvalidNetworkField
	NotifErrSubcodeMalformedAsPath
)

update message subcodes

type NotificationMessage

type NotificationMessage struct {
	Code    NotifErrCode
	Subcode NotifErrSubcode
	Data    []byte
}

NotificationMessage is a bgp message.

https://tools.ietf.org/html/rfc4271#section-4.5

func (*NotificationMessage) MessageType

func (n *NotificationMessage) MessageType() MessageType

MessageType returns the appropriate MessageType for NotificationMessage.

type OriginCode

type OriginCode uint8

OriginCode describes the type of origin in the origin attribute.

https://tools.ietf.org/html/rfc4271#section-5.1.1

const (
	OriginCodeIGP OriginCode = iota
	OriginCodeEGP
	OriginCodeIncomplete
)

OriginCode values

func (OriginCode) String

func (o OriginCode) String() string

type OspfRouteType

type OspfRouteType uint8

OspfRouteType describes the type of ospf route.

https://tools.ietf.org/html/rfc7752#section-3.2.3.1

const (
	OspfRouteTypeIntraArea OspfRouteType
	OspfRouteTypeInterArea
	OspfRouteTypeExternal1
	OspfRouteTypeExternal2
	OspfRouteTypeNSSA1
	OspfRouteTypeNSSA2
)

OspfRouteType values

type PathAttr

type PathAttr interface {
	Flags() PathAttrFlags
	Type() PathAttrType
	// contains filtered or unexported methods
}

PathAttr is a bgp path attribute.

type PathAttrAsPath

type PathAttrAsPath struct {
	Segments []AsPathSegment
	// contains filtered or unexported fields
}

PathAttrAsPath is a path attribute.

https://tools.ietf.org/html/rfc4271#section-5.1.2

func (*PathAttrAsPath) Flags

func (a *PathAttrAsPath) Flags() PathAttrFlags

Flags returns the appropriate PathAttrFlags for PathAttrAsPath.

func (*PathAttrAsPath) Type

func (a *PathAttrAsPath) Type() PathAttrType

Type returns the appropriate PathAttrType for PathAttrAsPath.

type PathAttrFlags

type PathAttrFlags struct {
	Optional       bool
	Transitive     bool
	Partial        bool
	ExtendedLength bool
}

PathAttrFlags contains the flags for a bgp path attribute.

type PathAttrLinkState

type PathAttrLinkState struct {
	NodeAttrs   []NodeAttr
	LinkAttrs   []LinkAttr
	PrefixAttrs []PrefixAttr
	// contains filtered or unexported fields
}

PathAttrLinkState is a bgp path attribute.

https://tools.ietf.org/html/rfc7752#section-3.3

func (*PathAttrLinkState) Flags

func (p *PathAttrLinkState) Flags() PathAttrFlags

Flags returns the flags for a link state path attribute.

func (*PathAttrLinkState) Type

func (p *PathAttrLinkState) Type() PathAttrType

Type returns the appropriate PathAttrType for PathAttrLinkState.

type PathAttrLocalPref

type PathAttrLocalPref struct {
	Preference uint32
	// contains filtered or unexported fields
}

PathAttrLocalPref is a path attribute.

https://tools.ietf.org/html/rfc4271#section-5.1.5

func (*PathAttrLocalPref) Flags

func (p *PathAttrLocalPref) Flags() PathAttrFlags

Flags returns the PathAttrFlags for PathAttrLocalPref.

func (*PathAttrLocalPref) Type

func (p *PathAttrLocalPref) Type() PathAttrType

Type returns the appropriate PathAttrType for PathAttrLocalPref.

type PathAttrMpReach

type PathAttrMpReach struct {
	Afi  MultiprotoAfi
	Safi MultiprotoSafi
	Nlri []LinkStateNlri
	// contains filtered or unexported fields
}

PathAttrMpReach is a path attribute.

https://tools.ietf.org/html/rfc4760#section-3

func (*PathAttrMpReach) Flags

func (p *PathAttrMpReach) Flags() PathAttrFlags

Flags returns the PathAttrFlags for PathAttrMpReach.

func (*PathAttrMpReach) Type

func (p *PathAttrMpReach) Type() PathAttrType

Type returns the appropriate PathAttrType for PathAttrMpReach.

type PathAttrMpUnreach

type PathAttrMpUnreach struct {
	Afi  MultiprotoAfi
	Safi MultiprotoSafi
	Nlri []LinkStateNlri
	// contains filtered or unexported fields
}

PathAttrMpUnreach is a path attribute.

https://tools.ietf.org/html/rfc4760#section-4

func (*PathAttrMpUnreach) Flags

func (p *PathAttrMpUnreach) Flags() PathAttrFlags

Flags returns the PathAttrFlags for PathAttrMpUnreach.

func (*PathAttrMpUnreach) Type

func (p *PathAttrMpUnreach) Type() PathAttrType

Type returns the appropriate PathAttrType for PathAttrMpUnreach.

type PathAttrOrigin

type PathAttrOrigin struct {
	Origin OriginCode
	// contains filtered or unexported fields
}

PathAttrOrigin is a path attribute.

https://tools.ietf.org/html/rfc4271#section-5.1.1

func (*PathAttrOrigin) Flags

func (o *PathAttrOrigin) Flags() PathAttrFlags

Flags returns the PathAttrFlags for PathAttrOrigin.

func (*PathAttrOrigin) Type

func (o *PathAttrOrigin) Type() PathAttrType

Type returns the appropriate PathAttrType for PathAttrOrigin.

type PathAttrType

type PathAttrType uint8

PathAttrType describes the type of a bgp path attribute.

const (
	PathAttrOriginType    PathAttrType = 1
	PathAttrAsPathType    PathAttrType = 2
	PathAttrLocalPrefType PathAttrType = 5
	PathAttrMpReachType   PathAttrType = 14
	PathAttrMpUnreachType PathAttrType = 15
	PathAttrLinkStateType PathAttrType = 29
)

PathAttrType values

type PrefixAttr

type PrefixAttr interface {
	Code() PrefixAttrCode
	// contains filtered or unexported methods
}

PrefixAttr is a prefix attribute contained in a bgp-ls attribute.

type PrefixAttrCode

type PrefixAttrCode uint16

PrefixAttrCode describes the type of prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.3

const (
	PrefixAttrCodeIgpFlags              PrefixAttrCode = 1152
	PrefixAttrCodeIgpRouteTag           PrefixAttrCode = 1153
	PrefixAttrCodeIgpExtendedRouteTag   PrefixAttrCode = 1154
	PrefixAttrCodePrefixMetric          PrefixAttrCode = 1155
	PrefixAttrCodeOspfForwardingAddress PrefixAttrCode = 1156
	PrefixAttrCodeOpaquePrefixAttribute PrefixAttrCode = 1157
	PrefixAttrCodePrefixSID             PrefixAttrCode = 1158
	PrefixAttrCodeRange                 PrefixAttrCode = 1159
	PrefixAttrCodeFlags                 PrefixAttrCode = 1170
	PrefixAttrCodeSourceRouterID        PrefixAttrCode = 1171
)

PrefixAttrCode values

type PrefixAttrFlagsIsIs

type PrefixAttrFlagsIsIs struct {
	External        bool
	Readvertisement bool
	Node            bool
}

PrefixAttrFlagsIsIs is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.3.2

https://tools.ietf.org/html/rfc7794#section-2.1

func (*PrefixAttrFlagsIsIs) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrFlagsIsIs

type PrefixAttrFlagsOSPFv2

type PrefixAttrFlagsOSPFv2 struct {
	Attach bool
	Node   bool
}

PrefixAttrFlagsOSPFv2 is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.3.2

https://tools.ietf.org/html/rfc7684#section-2.1

func (*PrefixAttrFlagsOSPFv2) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrFlagsOSPFv2

type PrefixAttrFlagsOSPFv3

type PrefixAttrFlagsOSPFv3 struct {
	DN           bool
	Propagate    bool
	LocalAddress bool
	NoUnicast    bool
}

PrefixAttrFlagsOSPFv3 is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.3.2

https://tools.ietf.org/html/rfc5340#appendix-A.4.1.1

func (*PrefixAttrFlagsOSPFv3) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrFlagsOSPFv3

type PrefixAttrIgpExtendedRouteTag

type PrefixAttrIgpExtendedRouteTag struct {
	Tags []uint64
}

PrefixAttrIgpExtendedRouteTag is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.3.3

func (*PrefixAttrIgpExtendedRouteTag) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrIgpExtendedRouteTag.

type PrefixAttrIgpFlags

type PrefixAttrIgpFlags struct {
	IsIsDown          bool
	OspfNoUnicast     bool
	OspfLocalAddress  bool
	OspfPropagateNssa bool
}

PrefixAttrIgpFlags is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.3.1

func (*PrefixAttrIgpFlags) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrIgpFlags.

type PrefixAttrIgpRouteTag

type PrefixAttrIgpRouteTag struct {
	Tags []uint32
}

PrefixAttrIgpRouteTag is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.3.2

func (*PrefixAttrIgpRouteTag) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrIgpRouteTag.

type PrefixAttrOpaquePrefixAttribute

type PrefixAttrOpaquePrefixAttribute struct {
	Data []byte
}

PrefixAttrOpaquePrefixAttribute is a prefix attribute contained in a bgp-ls attribute.

func (*PrefixAttrOpaquePrefixAttribute) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrOpaquePrefixAttribute.

type PrefixAttrOspfForwardingAddress

type PrefixAttrOspfForwardingAddress struct {
	Address net.IP
}

PrefixAttrOspfForwardingAddress is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.3.5

func (*PrefixAttrOspfForwardingAddress) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrOspfForwardingAddress.

type PrefixAttrPrefixMetric

type PrefixAttrPrefixMetric struct {
	Metric uint32
}

PrefixAttrPrefixMetric is a prefix attributed contained in a bgp-ls attribute.

https://tools.ietf.org/html/rfc7752#section-3.3.3.4

func (*PrefixAttrPrefixMetric) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrPrefixMetric.

type PrefixAttrPrefixSID

type PrefixAttrPrefixSID struct {
	Flags         PrefixAttrPrefixSIDFlags
	Algorithm     uint8
	SIDIndexLabel SIDIndexLabel
}

PrefixAttrPrefixSID is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.3.1

func (*PrefixAttrPrefixSID) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrPrefixSID

type PrefixAttrPrefixSIDFlags

type PrefixAttrPrefixSIDFlags interface {
	Type() PrefixAttrPrefixSIDFlagsType
	// contains filtered or unexported methods
}

PrefixAttrPrefixSIDFlags are contained in a PrefixAttrPrefixSID prefix attribute.

type PrefixAttrPrefixSIDFlagsIsIs

type PrefixAttrPrefixSIDFlagsIsIs struct {
	Readvertisement bool
	NodeSID         bool
	NoPHP           bool
	ExplicitNull    bool
	Value           bool
	Local           bool
}

PrefixAttrPrefixSIDFlagsIsIs are contained in a PrefixAttrPrefixSID prefix attribute.

https://tools.ietf.org/html/draft-ietf-isis-segment-routing-extensions-15#section-2.1

func (*PrefixAttrPrefixSIDFlagsIsIs) Type

Type returns the appropriate PrefixAttrPrefixSIDFlagsType for PrefixAttrPrefixSIDFlagsIsIs.

type PrefixAttrPrefixSIDFlagsOspf

type PrefixAttrPrefixSIDFlagsOspf struct {
	NoPHP         bool
	MappingServer bool
	ExplicitNull  bool
	Value         bool
	Local         bool
}

PrefixAttrPrefixSIDFlagsOspf are contained in a PrefixAttrPrefixSID prefix attribute.

https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-24#section-5

func (*PrefixAttrPrefixSIDFlagsOspf) Type

Type returns the appropriate PrefixAttrPrefixSIDFlagsType for PrefixAttrPrefixSIDFlagsOspf.

type PrefixAttrPrefixSIDFlagsType

type PrefixAttrPrefixSIDFlagsType uint8

PrefixAttrPrefixSIDFlagsType describes the type of PrefixAttrPrefixSIDFlags contained in a PrefixAttrPrefixSID prefix attribute.

const (
	PrefixAttrPrefixSIDFlagsTypeIsIs PrefixAttrPrefixSIDFlagsType = iota
	PrefixAttrPrefixSIDFlagsTypeOspf
)

PrefixAttrPrefixSIDFlagsType values

type PrefixAttrRange

type PrefixAttrRange struct {
	Flags     PrefixAttrRangeFlags
	RangeSize uint16
	PrefixSID []*PrefixAttrPrefixSID
}

PrefixAttrRange is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.3.4

func (*PrefixAttrRange) Code

func (p *PrefixAttrRange) Code() PrefixAttrCode

Code returns the appropriate PrefixAttrCode for PrefixAttrRange

type PrefixAttrRangeFlags

type PrefixAttrRangeFlags interface {
	Type() PrefixAttrRangeFlagsType
	// contains filtered or unexported methods
}

PrefixAttrRangeFlags are contained in a PrefixAttrRange prefix attribute.

type PrefixAttrRangeFlagsIsIs

type PrefixAttrRangeFlagsIsIs struct {
	AddressFamily bool
	Mirror        bool
	SFlag         bool
	DFlag         bool
	Attached      bool
}

PrefixAttrRangeFlagsIsIs are contained in a PrefixAttrRange prefix attribute.

func (*PrefixAttrRangeFlagsIsIs) Type

Type returns the appropriate PrefixAttrRangeFlagsType for PrefixAttrRangeFlagsIsIs.

type PrefixAttrRangeFlagsOspf

type PrefixAttrRangeFlagsOspf struct {
	InterArea bool
}

PrefixAttrRangeFlagsOspf are contained in a PrefixAttrRange prefix attribute.

https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-24#section-4

func (*PrefixAttrRangeFlagsOspf) Type

Type returns the appropriate PrefixAttrRangeFlagsType for PrefixAttrRangeFlagsOspf.

type PrefixAttrRangeFlagsType

type PrefixAttrRangeFlagsType uint8

PrefixAttrRangeFlagsType describes the type of PrefixAttrRangeFlags.

const (
	PrefixAttrRangeFlagsTypeIsIs PrefixAttrRangeFlagsType = iota
	PrefixAttrRangeFlagsTypeOspf
)

PrefixAttrRangeFlagsType values

type PrefixAttrSourceRouterID

type PrefixAttrSourceRouterID struct {
	RouterID net.IP
}

PrefixAttrSourceRouterID is a prefix attribute contained in a bgp-ls attribute.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.3.3

func (*PrefixAttrSourceRouterID) Code

Code returns the appropriate PrefixAttrCode for PrefixAttrSourceRouterID

type PrefixDescriptor

type PrefixDescriptor interface {
	Code() PrefixDescriptorCode
	// contains filtered or unexported methods
}

PrefixDescriptor is a bgp-ls prefix descriptor.

https://tools.ietf.org/html/rfc7752#section-3.2.3

type PrefixDescriptorCode

type PrefixDescriptorCode uint16

PrefixDescriptorCode describes the type of prefix descriptor.

https://tools.ietf.org/html/rfc7752#section-3.2.3

const (
	PrefixDescriptorCodeMultiTopologyID    PrefixDescriptorCode = 263
	PrefixDescriptorCodeOspfRouteType      PrefixDescriptorCode = 264
	PrefixDescriptorCodeIPReachabilityInfo PrefixDescriptorCode = 265
)

PrefixDescriptorCode values

type PrefixDescriptorIPReachabilityInfo

type PrefixDescriptorIPReachabilityInfo struct {
	PrefixLength uint8
	Prefix       net.IP
}

PrefixDescriptorIPReachabilityInfo is a prefix descriptor contained in a bgp-ls nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.3.2

func (*PrefixDescriptorIPReachabilityInfo) Code

Code returns the appropriate PrefixDescriptorCode for PrefixDescriptorIPReachabilityInfo.

type PrefixDescriptorMultiTopologyID

type PrefixDescriptorMultiTopologyID struct {
	IDs []uint16
}

PrefixDescriptorMultiTopologyID is a prefix descriptor contained in a bgp-ls nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.1.5

func (*PrefixDescriptorMultiTopologyID) Code

Code returns the appropriate PrefixDescriptorCode for PrefixDescriptorMultiTopologyID.

type PrefixDescriptorOspfRouteType

type PrefixDescriptorOspfRouteType struct {
	RouteType OspfRouteType
}

PrefixDescriptorOspfRouteType is a prefix descriptor contained in a bgp-ls nlri.

https://tools.ietf.org/html/rfc7752#section-3.2.3.1

func (*PrefixDescriptorOspfRouteType) Code

Code returns the appropriate PrefixDescriptorCode for PrefixDescriptorOspfRouteType.

type RangeSIDLabel

type RangeSIDLabel struct {
	RangeSize uint32
	SIDLabel  SIDLabel
}

RangeSIDLabel is contained in the NodeAttrSRCaps and NodeAttrSRLocalBlock node attributes.

type SIDIndexLabel

type SIDIndexLabel interface {
	Type() SIDIndexLabelType
	// contains filtered or unexported methods
}

SIDIndexLabel is a common, variable field in SR-related attrs and contains either an mpls label or a 4 octet index defining an offset. Drafts refer to this as SID/Index/Label or SID/Label/Index.

type SIDIndexLabelLabel

type SIDIndexLabelLabel struct {
	Label uint32
}

SIDIndexLabelLabel is an mpls label contained in a SIDIndexLabel

func (*SIDIndexLabelLabel) Type

Type returns the appropriate SIDIndexLabelType for SIDIndexLabelLabel

type SIDIndexLabelOffset

type SIDIndexLabelOffset struct {
	Offset uint32
}

SIDIndexLabelOffset represents an offset is contained in a SIDIndexLabel.

func (*SIDIndexLabelOffset) Type

Type returns the appropriate SIDIndexLabelType for SIDIndexLabelOffset

type SIDIndexLabelType

type SIDIndexLabelType uint8

SIDIndexLabelType describes the type of variable SR field.

const (
	SIDIndexLabelTypeLabel  SIDIndexLabelType = 3
	SIDIndexLabelTypeOffset SIDIndexLabelType = 4
)

SIDIndexLabelType values

type SIDLabel

type SIDLabel interface {
	Type() SIDLabelType
	// contains filtered or unexported methods
}

SIDLabel is contained in the NodeAttrSRCaps and NodeAttrSRLocalBlock node attributes.

https://tools.ietf.org/html/draft-ietf-idr-bgp-ls-segment-routing-ext-04#section-2.1.1

type SIDLabelLabel

type SIDLabelLabel struct {
	Label uint32
}

SIDLabelLabel contains a 3 octet label.

func (*SIDLabelLabel) Type

func (s *SIDLabelLabel) Type() SIDLabelType

Type returns the appropriate SIDLabelType for SIDLabeLabel.

type SIDLabelSID

type SIDLabelSID struct {
	SID uint32
}

SIDLabelSID contains a 4 octet SID.

func (*SIDLabelSID) Type

func (s *SIDLabelSID) Type() SIDLabelType

Type returns the appropriate SIDLabelType for SIDLabelSID.

type SIDLabelType

type SIDLabelType uint8

SIDLabelType describes the type of SIDLabel attribute.

const (
	SIDLabelTypeSID SIDLabelType = iota
	SIDLabelTypeLabel
)

SIDLabelType values

type UpdateMessage

type UpdateMessage struct {
	PathAttrs []PathAttr
}

UpdateMessage is a bgp message.

func (*UpdateMessage) MessageType

func (u *UpdateMessage) MessageType() MessageType

MessageType returns the appropriate MessageType for UpdateMessage.

Jump to

Keyboard shortcuts

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