Documentation
¶
Index ¶
- Constants
- func BehaviorToString(behavior uint16) string
- func SegmentsEqual(a, b Segment) bool
- type EndpointBehavior
- type LsLink
- type LsNode
- type LsPrefix
- type LsSrv6SID
- type LsTED
- type Metric
- type MetricType
- type PolicyDiff
- type PolicyState
- type SIDStructure
- type SRPolicy
- type Segment
- type SegmentSRMPLS
- type SegmentSRv6
- type Srv6EndXSID
- type TEDElem
- type Waypoint
Constants ¶
View Source
const ( PolicyDown = PolicyState("down") PolicyUp = PolicyState("up") PolicyActive = PolicyState("active") PolicyUnknown = PolicyState("unknown") )
View Source
const ( BehaviorReserved uint16 = 0x0000 BehaviorEND uint16 = 0x0001 BehaviorENDX uint16 = 0x0005 BehaviorUN uint16 = 0x0030 BehaviorUA uint16 = 0x0039 )
View Source
const FirstSIDIndex = 0 // Index for first SID in Sids array
View Source
const SRv6SIDBitLength = 128
Variables ¶
This section is empty.
Functions ¶
func BehaviorToString ¶
func SegmentsEqual ¶
Helper function for Segment interface equality check
Types ¶
type EndpointBehavior ¶
type LsLink ¶
type LsLink struct {
LocalNode *LsNode // Primary key, in MP_REACH_NLRI Attr
RemoteNode *LsNode // Primary key, in MP_REACH_NLRI Attr
LocalIP netip.Addr // In MP_REACH_NLRI Attr
RemoteIP netip.Addr // In MP_REACH_NLRI Attr
Metrics []*Metric // In BGP-LS Attr
AdjSid uint32 // In BGP-LS Attr
Srv6EndXSID *Srv6EndXSID // In BGP-LS Attr
}
type LsNode ¶
type LsNode struct {
ASN uint32 // primary key, in MP_REACH_NLRI Attr
RouterID string // primary key, in MP_REACH_NLRI Attr
IsisAreaID string // in BGP-LS Attr
Hostname string // in BGP-LS Attr
SrgbBegin uint32 // in BGP-LS Attr
SrgbEnd uint32 // in BGP-LS Attr
Links []*LsLink
Prefixes []*LsPrefix
SRv6SIDs []*LsSrv6SID
}
func (*LsNode) AddSrv6SID ¶
func (*LsNode) NodeSegment ¶
type LsPrefix ¶
type LsPrefix struct {
LocalNode *LsNode // primary key, in MP_REACH_NLRI Attr
Prefix netip.Prefix // in MP_REACH_NLRI Attr
SidIndex uint32 // in BGP-LS Attr (only for Lo Address Prefix)
}
func NewLsPrefix ¶
type LsSrv6SID ¶
type LsSrv6SID struct {
LocalNode *LsNode // primary key, in MP_REACH_NLRI Attr
Sids []string // in LsSrv6SID Attr
EndpointBehavior EndpointBehavior // in BGP-LS Attr
SIDStructure SIDStructure // in BGP-LS Attr
MultiTopoIDs []uint32 // in LsSrv6SID Attr
}
func NewLsSrv6SID ¶
type LsTED ¶
type Metric ¶
type Metric struct {
Type MetricType
Value uint32
}
func NewMetric ¶
func NewMetric(metricType MetricType, value uint32) *Metric
type MetricType ¶
type MetricType int
const ( IGPMetric MetricType = iota TEMetric DelayMetric HopcountMetric )
func (MetricType) String ¶
func (m MetricType) String() string
type PolicyDiff ¶
type PolicyDiff struct {
Name *string
Color *uint32
Preference *uint32
SegmentList []Segment
LSPID uint16
State PolicyState
}
SR Policy parameter that can be changed
type SIDStructure ¶
type SRPolicy ¶
type SRPolicy struct {
PlspID uint32
Name string
SegmentList []Segment
SrcAddr netip.Addr
DstAddr netip.Addr
Color uint32
Preference uint32
LSPID uint16
State PolicyState
}
func NewSRPolicy ¶
func (*SRPolicy) Update ¶
func (p *SRPolicy) Update(df PolicyDiff)
type SegmentSRMPLS ¶
type SegmentSRMPLS struct {
Sid uint32
}
func NewSegmentSRMPLS ¶
func NewSegmentSRMPLS(sid uint32) SegmentSRMPLS
func (SegmentSRMPLS) Equal ¶
func (seg SegmentSRMPLS) Equal(other SegmentSRMPLS) bool
Equal for SegmentSRMPLS
func (SegmentSRMPLS) SidString ¶
func (seg SegmentSRMPLS) SidString() string
type SegmentSRv6 ¶
type SegmentSRv6 struct {
Sid netip.Addr
LocalAddr netip.Addr
RemoteAddr netip.Addr
Structure []uint8
USid bool
}
func NewSegmentSRv6 ¶
func NewSegmentSRv6(sid netip.Addr) SegmentSRv6
func NewSegmentSRv6WithNodeInfo ¶
func NewSegmentSRv6WithNodeInfo(sid netip.Addr, n *LsNode) (SegmentSRv6, error)
func (SegmentSRv6) Behavior ¶
func (seg SegmentSRv6) Behavior() (uint16, error)
func (SegmentSRv6) Equal ¶
func (seg SegmentSRv6) Equal(other SegmentSRv6) bool
Equal for SegmentSRv6
func (SegmentSRv6) SidString ¶
func (seg SegmentSRv6) SidString() string
type Srv6EndXSID ¶
type Srv6EndXSID struct {
EndpointBehavior uint16
Sids []string
Srv6SIDStructure SIDStructure
}
Click to show internal directories.
Click to hide internal directories.